Which algorithm is used in the top tree data structure?
Options
- A. Greedy
- B. Divide and Conquer
- C. Branch
- D. Backtracking
B. Divide and Conquer
A Top Tree is a data structure used mainly for dynamic trees (like dynamic graph connectivity).
It works by:
Dividing the tree into smaller clusters
Processing those clusters
Combining results
This follows the Divide and Conquer approach:
Divide the structure
Solve smaller parts
Merge results
Greedy → Used in algorithms like Prim’s, Kruskal’s
Backtracking → Used in N-Queen, Sudoku
Branch → Not a complete algorithm type (usually “Branch and Bound”)
Attempt Quiz Now:
BPSC Tre 4.0 DSA Practice Set