Array Indexing
Which of the following best describes how you access the third element in a zero-indexed array in most programming languages?
- array[2]
- array[3]
- array{2}
- array(2)
- array.second
Stack Operations
What is the name of the operation used to remove the top element from a stack?
- Pop
- Peek
- Push
- Pull
- Pick
Queue Usage Scenario
Which data structure is best suited for managing tasks in a printer queue, where the first submitted document should be printed first?
- Queue
- Stack
- Array
- Heap
- Tree
Linked List Traversal
To visit each node in a singly linked list starting from the head, what operation do you use to move to the next node?
- current = current.next
- current = current.previous
- current = current[1]
- current = head.previous
- current = tail
Stack Usage Example
Which real-world situation is best modeled using a stack data structure?
- Undo feature in text editors
- Customer service ticket queue
- Playlist shuffle
- Train carriages connected in a line
- Dictionary of words
Queue Methods
In queue operations, which method is used to add an item to the rear of the queue?
- Enqueue
- Dequeue
- Enqeuue
- Push
- AppendToFront
Array Size Limitation
What is a primary limitation of standard static arrays compared to linked lists?
- They require a fixed size at creation
- They allow fast random access
- They can be resized easily
- They support insertion anywhere in O(1) time
- They are always sorted automatically
Linked List Insertion
In a singly linked list, what must be updated to insert a new node between two existing nodes?
- The next pointer of the previous node
- The head pointer only
- Both next and previous pointers
- The value of the new node only
- The last node’s pointer to null
Stack LIFO Principle
Which principle does a stack follow when managing elements?
- Last In, First Out
- First In, First Out
- Least Recently Used
- Random Access
- First Come, Last Serve
Queue Real-World Example
Which of these activities best illustrates the FIFO (First-In-First-Out) principle of a queue?
- People lining up to buy tickets at a theater
- Arranging books on a shelf
- Flipping through undo steps
- Browsing browser history in reverse
- Organizing nested folders