Tag: Iterators
How to erase elements from a list in c++ using iterators
In this article we will see how to erase elements from a std::list using iterators. std::list provides 2 member function to delete elements using iterators i.e. Advertisements iterator erase (const_iterator position); It deletes the element representing by passed iterator “position” and returns the iterator of element next to last deleted element. iterator erase (const_iterator first, const_iterator last); …
How to erase elements from a list in c++ using iteratorsRead More
Python : Iterators vs Generators
In this article we will discuss the differences between Iterators and Generators in Python. Iterators and Generators both serves similar purpose i.e. both provides the provision to iterate over a collection of elements one by one. But still both are different. Let’s discuss how they are different Advertisements Ease of implementation Making your class Iterable …
Iterators and Generators in Python
S.NO Iterators and Generators Tutorials in Python 9.1 Iterator vs Iterable vs Iteration in Python 9.2 How to make a class Iterable in Python? 9.3 Yield Keyword & Generators in Python 9.4 Iterators vs Generators in Python 9.5 List Comprehension Vs Generator Expression in Python