Complete the code to push an element onto an array-based stack.
stack[top] = element; top[1]=1;
We add 1 to the top index after placing the element to move the top pointer up.
Complete the code to pop an element from a linked list stack.
Node temp = top; top = top.[1]; return temp.data;
In a linked list stack, the top points to the latest node. We move top to the next node after popping.
Fix the error in checking if the array stack is full.
if (top [1] stack.length) { throw new StackOverflowError(); }
The top index equals the stack length when the stack is full, so '>=' is correct.
Fill both blanks to complete the linked list stack push method.
Node newNode = new Node(element); newNode.[1] = top; top = [2];
The new node's next points to the current top, then top is updated to the new node.
Fill all three blanks to create a dictionary comprehension that filters stack elements greater than 10.
Map<Integer, Integer> filtered = stackElements.entrySet().stream().filter(e -> e.getValue() [1] 10).collect(Collectors.toMap(e -> e.[2], e -> e.[3]));
We filter entries with values greater than 10, then collect keys and values properly.
