Set List Element at Index Property
result of storing value at index idx of stack elements = set index idx of remaining stack elements to value with visited : [ ]
This property says that the result of setting an element of a list at some index is equal to the set operation where the "visited" list is an empty list. The "remaining" list is initially same as the original list, but it becomes shorter as we move toward the index. Also, this conversion allows us to track the visited elements in the list while moving to the index.
Examples
result of storing 10 at index 1 of stack [ 2, [ 4, [ 8, [ ] ] ] ] = set index 1 of remaining stack [ 2, [ 4, [ 8, [ ] ] ] ] to 10 with visited : [ ]
result of storing Melon at index 2 of stack [ "Apple", [ "Orange", [ "Tomato", [ ] ] ] ] = set index 2 of remaining stack [ "Apple", [ "Orange", [ "Tomato", [ ] ] ] ] to Melon with visited : [ ]
result of storing True at index 0 of stack [ True, [ False, [ ] ] ] = set index 0 of remaining stack [ True, [ False, [ ] ] ] to True with visited : [ ]
Comments
Please log in to add comments