Tags » Iterator

Python - Iterators

Post contents:
– What is an iterator?
– Examples
– Pros/Cons
– Cases

What is an iterator?

https://docs.python.org/2/glossary.html#term-iterator defines an iterator as

An object representing a stream of data.

844 more words
Python

More Project Euler madness

Finished problem 3 of Project Euler (woo!)

My solution in python is up here

The problem is here

Notable about this problem was how it required me to approach the problem, and realizing that the answer ties into the concept of… 196 more words

Ruby : Array : Iterate the given block for each array of consecutive elements

each_cons(p1) public

Iterates the given block for each array of consecutive <n> elements. If no block is given, returns an enumerator. 61 more words

Ruby

Custom Iterators in Ruby

Of all the things I’ve learned so far on my Ruby journey, custom iterators has been the hardest for me to wrap my head around. So I’m going to walk you (me) through how they are constructed, step by step. 351 more words

Sorting and Pagination is one of the most important things that we need on a page when we are dealing with large data sets. When we are sorting a Sobject list , it is easy to use Order By clause in SOQL and get the desired results. 798 more words

Comparable

Binary Tree - Iterator for in order traversal

Basics

The idea behind writing an iterator is to traverse a binary tree in successive steps. Based on traversal, this iterator can either traverse in order, pre order or post order. 64 more words

Binary Tree

Blocks and Rubocop!

I am progressing in my development class at DaVinci Institute and a couple of nights ago we were assigned one of my favorite assignments so far: FizzBuzz. 436 more words

Rubocop