Quick Revision

GK One-Line Question & Answer

15541+ short questions with short answers, covering every category and sub-category on the site — no long articles to scroll through. Good for a fast recap before an exam, or a few minutes of daily practice.

Data Structures and Algorithms → Trees 11

B-tree is?
Self-balancing, each node can have more than 2 children
click to copy
B-tree was invented to?
Minimize disk accesses in secondary storage
click to copy
In B-tree of order m, each internal node has at most how many keys?
m-1
click to copy
B-tree: all leaves are at?
Same level (same depth)
click to copy
Key difference B-tree vs B+ tree?
B+ stores data only at leaves; B-tree at all nodes
click to copy
Height of perfect binary tree with 15 nodes?
3
click to copy
Maximum nodes in binary tree of height 4?
31
click to copy
Number of leaf nodes in perfect binary tree of height h?
2^h
click to copy
Preorder traversal used for?
Creating copy of tree (serialization)
click to copy
Maximum leaf nodes in binary tree of height h?
2^h
click to copy
Height of complete binary tree with 8 nodes?
3
click to copy

Data Structures and Algorithms → Introduction to DSA 26

B+ tree leaf nodes are connected as?
Linked list of leaves
click to copy
Tree degree?
Maximum of all node degrees
click to copy
Which traversal used for tree deletion (delete children before parent)?
Postorder
click to copy
What is a degenerate BST?
All nodes have one child (skewed like linked list)
click to copy
In BST, all operations on balanced tree?
O(log n)
click to copy
Siblings in tree are nodes that?
Share same parent
click to copy
Ancestors of a node are?
On path from root to node (higher in hierarchy)
click to copy
Internal node is?
Node with at least one child
click to copy
What is a forest?
A set of trees
click to copy
In Python BST, the Node class attributes are?
data, left, right, parent
click to copy
What is an undirected graph?
Edges have no direction (bidirectional)
click to copy
What is a directed graph?
Edges have direction (one-way)
click to copy
What is a null graph?
No edges
click to copy
What is a cyclic graph?
At least one cycle exists
click to copy
What is an acyclic graph?
No cycles
click to copy
Weighted graph?
Edges have numerical weights
click to copy
What is a connected graph?
Every pair has path between them
click to copy
What is a complete graph?
Every pair of vertices has an edge
click to copy
What is a multigraph?
Two or more edges between same pair of nodes
click to copy
Degree of a vertex?
Number of vertices connected by edges
click to copy
Two vertices are neighbours if?
Edge exists between them
click to copy
What is a path in a graph?
Sequence of alternating nodes and edges (successive nodes connected)
click to copy
What is a simple path?
No vertex repeated
click to copy
What is a bridge in a graph?
Edge whose removal disconnects graph
click to copy
What is BFS?
Level-by-level traversal using queue
click to copy
First step in BFS?
Put any vertex at back of queue
click to copy

Data Structures and Algorithms → Binary Search Tree 1

Inorder traversal of BST gives?
Sorted ascending order
click to copy

Data Structures and Algorithms → Graphs 2

A graph is?
Non-linear with vertices and edges
click to copy
In BFS after dequeuing a vertex?
Visit all adjacent unvisited, enqueue them
click to copy