2. Programming

Data Structures — Quiz

Test your understanding of data structures with 5 practice questions.

Read the lesson first

Practice Questions

Question 1

After inserting 8 elements into a dynamic array that doubles its capacity when full, how many total element copy operations have occurred?

Question 2

In a dynamic array that doubles its capacity when full, starting from capacity 1, how many times will resizing occur after inserting $n$ elements?

Question 3

In a stack implemented using two FIFO queues where the push operation is costly and pop is efficient, what are the time complexities of push and pop operations for $n$ elements?

Question 4

In a queue implemented using two LIFO stacks with amortized analysis, what are the amortized time complexities of enqueue and dequeue operations for a sequence of $n$ operations?

Question 5

In a doubly linked list with head and tail pointers, what is the time complexity to delete the last node given a direct pointer to that node?
Data Structures Quiz — AS-Level Computer Science | A-Warded