Array Lists & Linked List
Stacks, Queues, Circular Buffers
Recursion Trees
Binary Search Trees & AVL Trees
Time Complexity & Makefiles
100

What is the primary advantage of an Array List over a Linked List?

Faster random access of elements (O(1) vs O(n)).

100

What is the primary difference between a stack and a queue?

A stack follows LIFO, while a queue follows FIFO.

100

What is the base case in recursion?

The stopping condition that prevents infinite recursion.

100

What is the worst-case time complexity of searching in a BST?

O(n), if the tree is unbalanced.

100

What is the worst-case time complexity of searching in a sorted Array List?

O(log n) using binary search.

200

Why do Linked Lists use more memory per element than Array Lists?

They store extra pointers to the next (and possibly previous) nodes.

200

What is the time complexity of enqueue() in a queue implemented with a Linked List?

O(1), assuming a tail pointer is maintained.

200

What is the traversal order of an in-order tree traversal?

Left, Root, Right.

200

What is the height of a perfectly balanced AVL tree with 7 nodes?

 2.

200

What is the amortized cost per insertion in an Array List that doubles in size?

O(1).

300

What is the time complexity of inserting an element at the front of an Array List?

 O(n), because all elements must shift.

300

What operation must a circular buffer perform when it reaches capacity?

Overwrite old values or expand the buffer.

300

What does the following recursive function compute?

int mystery(int x, int y) {

  if (y == 0) return 1;

  return mystery(x, y - 1) * x;

}

Computes x^y (x raised to the power y).

300

What does an AVL tree do when an insertion causes an imbalance?

Performs rotations to restore balance.

300

What is the time complexity of searching for an element in a Linked List?

 O(n).

400

Which operations have O(1) time complexity for both Array Lists and Linked Lists?

pushAtBack() and size().

400

If a Stack is implemented using the front of an Array List, which operation has the same complexity as in a Linked List?

push() (both O(1)).

400

How many nodes are in a full binary tree with height h?

2^(h+1) - 1.

400

What property must a BST satisfy?

Left subtree contains smaller elements, right subtree contains larger elements.

400

What are the three main components of a Makefile rule?

Target, dependencies, and command.

500

Given an empty Array List with an initial capacity of 4, how many resizes occur when adding 10 elements?

2 (resizes at 4 and 8).

500

What happens if you try to pop() from an empty stack?

A runtime error (stack underflow) occurs.

500

What traversal order should be used to delete a binary tree?

Post-order.

500

Given a BST with unique values, what is the worst-case time complexity of finding the maximum value?

O(h), where h is the tree height.

500

What is the difference between compilation and linking?

Compilation converts source code to object files, linking combines object files into an executable.

M
e
n
u