Data Structures MCQs (Set-3)

What does a hash function produce?

A Array index candidate
B Sorted key list
C Tree height
D Graph path

What is a hash collision?

A Two arrays have same length
B A key is missing
C A tree contains duplicate leaves
D Keys share one slot

How does separate chaining handle collisions?

A Moves every key to root
B Stores a bucket of entries
C Discards the new key
D Sorts the whole table

What does open addressing do after collision?

A Creates a linked list always
B Probes other table slots
C Changes key contents
D Deletes the old entry

What does hash table load factor compare?

A Entries to table capacity
B Keys to graph vertices
C Tree height to width
D Bytes to processor speed

Why resize a hash table?

A Make keys immutable
B Sort entries by value
C Keep collisions manageable
D Remove every bucket

What does a map store?

A Only unique values
B Tree edges only
C Key and value pairs
D Ordered instructions

What does a set typically guarantee?

A Unique elements
B Sorted elements always
C Fixed element count
D Key value pairs

Which graph representation suits sparse graphs?

A Adjacency matrix
B Full binary tree
C Sorted array only
D Adjacency list

Which representation has O(V squared) space?

A Adjacency list
B Adjacency matrix
C Edge iterator
D Hash function

What is an edge in a graph?

A A stored array index
B Connection between vertices
C A tree root
D A hash bucket

What is a directed edge?

A Connection with an orientation
B Connection with no endpoints
C A sorted pair always
D A weight without vertices

What is a weighted graph edge?

A Connection without vertices
B A hash key only
C Connection with an associated cost
D A queue insertion

What is a cycle in a graph?

A Path with one vertex
B Tree with no root
C Path returning to its start
D Edge without endpoint

What does connected mean for an undirected graph?

A All vertices mutually reachable
B Every vertex has two edges
C No cycles are present
D All edges have equal weight

What does DAG stand for?

A Directed acyclic graph
B Data address group
C Double array graph
D Depth aligned grid

What does topological sorting order?

A Edges by numeric weight
B Keys by hash value
C Vertices respecting dependencies
D Nodes by insertion time

Which search finds shortest paths by edge count in an unweighted graph?

A Depth first search
B Binary search
C Linear probing
D Breadth first search

Which traversal explores a branch deeply before backtracking?

A Breadth first search
B Heap extraction
C Topological insertion
D Depth first search

What does disjoint set represent?

A A sorted key sequence
B Graph edge weights
C Groups of nonoverlapping elements
D A priority queue

What does union do in disjoint sets?

A Finds a shortest path
B Merges two groups
C Sorts a graph
D Deletes an isolated vertex

What does path compression improve?

A Array insertion order
B Heap root selection
C Graph matrix storage
D Future representative lookups

What does Kruskal's algorithm find?

A Shortest path with negative edges
B Largest binary heap
C Topological order
D Minimum spanning tree

What restriction does Dijkstra's algorithm require?

A Nonnegative edge weights
B A directed acyclic graph
C Equal edge weights
D No more than two vertices

Which algorithm handles negative edges without negative cycles?

A Dijkstra
B Bellman Ford
C Kruskal
D Binary search