iterator tag

6 questions


1 answers
90 views
0
There is something I don't understand about the code that contains the C++ iterator.(Difficulty level: Beginner)

Result of code: Question: Although I lack the concept of itator, I'm studying how to write while looking at the code to get a better sense of it.I don't understand the code below in the last for state...

1 years ago

1 answers
79 views
0
How do I eterate multiple iterables at the same time?

When there are two iterables, each element is paired foo = (1,2,3)bar = (4,5,6)for (f,b) in some_iterator(foo, bar): print f: , f ,; b: , bUse this code to make a result f: 1; b: 4f: 2; b: 5f: 3; b: 6...


1 answers
87 views
0
Why do you use an editor, not an index?

//code1for (int i = 0; i < some_vector.size(); i++){ //...}//Code2for (some_iterator = some_vector.begin(); some_iterator != some_vector.end(); some_iterator++){ //...}Usually, when you use a conta...

1 years ago

1 answers
82 views
0
If you use Java Iterator, you fall into an infinite loop.

If you do it like this, it's printed indefinitely. What's wrong with this?I don't understand the exact purpose of Iteratoriter = set1.iterator();import java.util.*;public class Generic1 { public stati...


1 answers
77 views
0
The etherator for the door"

Usually, when outputting all values to the iterator, from forfor (iter=list.begin();iter!=list.end();iter++) cout<< *iter;I understand it's written as... But it comes out as soon as it is iter=l...

2 years ago

1 answers
69 views
0
Python Interlator Questions

class MultipleIterator: def __init__(self, stop, divisor): self.current = 0 self.stop = stop self.divisor = divisor def __iter__(self): return self def __next__(self): self.current += 1 if self....

2 years ago

© 2024 OneMinuteCode. All rights reserved.