Data Structures and Algorithms Flashcards
6 cards from real IKM 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
What is the worst-case time complexity of binary search on a sorted array of n elements?
Answer: O(log n)
Binary search halves the search range at each step, so it needs at most about log2(n) comparisons. It requires the data to be sorted.
Which data structure uses LIFO (last in, first out) ordering?
Answer: Stack
A stack adds and removes elements at the same end, so the most recently pushed item is the first one popped. A queue is FIFO.
What is the average-case time complexity of quicksort?
Answer: O(n log n)
Quicksort partitions the data around a pivot and recurses, giving O(n log n) on average. Its worst case, for example a poor pivot on already sorted data, is O(n^2).
Which traversal of a binary search tree visits the nodes in ascending sorted order?
Answer: In-order
In-order traversal visits left subtree, node, then right subtree. In a binary search tree this produces the keys in ascending order.
What is the average time complexity of looking up a key in a well-implemented hash table?
Answer: O(1)
A good hash function distributes keys evenly, so lookup, insertion and deletion take constant time on average. Heavy collisions can degrade the worst case to O(n).
Which algorithm is typically used to find the shortest path from one source node to all others in a weighted graph with non-negative edge weights?
Answer: Dijkstra's algorithm
Dijkstra's algorithm repeatedly settles the closest unvisited node, and it is correct as long as no edge weight is negative. Kruskal's algorithm builds a minimum spanning tree instead.
Written and edited by Nathan Beja, founder of Practice Test Geeks, with AI assistance. Exam facts are checked against the official sources linked below. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- ikmnet.com — Test delivery, passing score · verified Oct 2026
- online.ikmnet.com — Eligibility, exam format, retake policy, score release, time limit · verified Oct 2026