Data Structures and Algorithms Flashcards
6 cards from real AMCAT practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 Data Structures and Algorithms flashcards as text
Which data structure operates on a Last In, First Out (LIFO) principle?
Answer: Stack
A stack follows LIFO, where the last element added is the first one removed.
What is the worst-case time complexity of Binary Search?
Answer: O(log n)
Binary Search repeatedly halves the search space, giving O(log n) worst-case complexity.
Which traversal of a Binary Search Tree visits nodes in sorted ascending order?
Answer: In-order
In-order traversal (left-root-right) visits BST nodes in ascending sorted order.
What is the maximum number of nodes in a binary tree of height h?
Answer: 2^(h+1) − 1
A full binary tree of height h has at most 2^(h+1) − 1 nodes.
Which data structure is best suited for implementing a priority queue?
Answer: Heap
A heap efficiently supports insertion and extraction of the minimum/maximum element in O(log n).
In a singly linked list, what does the last node's 'next' pointer point to?
Answer: NULL
The last node's 'next' pointer is set to NULL to indicate the end of the list.