In: Computer Science
Which of the following statements is true about sets?
A) The data items are inserted in the same order as they are traversed by an iterator.
B) The data items are inserted in the first in last out manner.
C) The data items are traversed by an iterator in the same order as they were inserted.
D) The data items are traversed by an iterator in a sorted order that can be different from the order in which they were inserted.
Please find the answer below::
A) The data items are inserted in the same order as they are traversed by an iterator. :: It's true, Insertion happened in the same order as they were traversed.
B) The data items are inserted in the first in last out manner. : It is false. first in last out is happened in stack
C) The data items are traversed by an iterator in the same order as they were inserted. : traversing can be random , So it is false
D) The data items are traversed by an iterator in a sorted order that can be different from the order in which they were inserted. : Data won't be in sorted form, It is false