Begin Pop At Index Property

remaining elements after xs is popped at index idx = remaining elements after xs is popped at index idx and visited stack is [ ]

This property says that the result of popping an element at some index is equivalent to a popping operation that keeps track of the elements visited so far. This conversion doesn't do much other than to initialize the empty "visited" list so that we can begin visiting the elements one by one.

Examples

remaining elements after [ 2, [ 4, [ 8, [ ] ] ] ] is popped at index 1 = remaining elements after [ 2, [ 4, [ 8, [ ] ] ] ] is popped at index 1 and visited stack is [ ]

remaining elements after [ "Apple", [ "Orange", [ "Tomato", [ ] ] ] ] is popped at index 2 = remaining elements after [ "Apple", [ "Orange", [ "Tomato", [ ] ] ] ] is popped at index 2 and visited stack is [ ]

remaining elements after [ True, [ False, [ ] ] ] is popped at index 0 = remaining elements after [ True, [ False, [ ] ] ] is popped at index 0 and visited stack is [ ]


Comments

Please log in to add comments