chapter

    Hierarchical Data Structures Pyqs for Cmi M.sc. and Ph.d. Computer Science

    Solve 2+ Hierarchical Data Structures previous year questions for CMI M.Sc. and Ph.D. Computer Science with answers and detailed solutions. Free sample questi

    Try a question

    Answer it here to see how it works. Nothing is recorded until you sign in.

    Question 1
    2022 PYQ

    A ternary tree starts with a single root node at the top of the tree. Each node in the tree can have up to three nodes as its children. No node in the tree is the child of two different nodes. A node which has no children is called a leaf node.

    Question 2
    2021 PYQ

    A binary tree starts with a single root node at the top of the tree. Each node can have either a left child or a right child, or both, or neither. The children of a node are drawn below it, connected by edges. Here are the five possible binary trees with three nodes.

    Free preview ends here

    Login to view the complete previous-year questions and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Hierarchical Data Structures PYQs for CMI M.Sc. and Ph.D. Computer Science

    Solve 2+ Hierarchical Data Structures previous year questions for CMI M.Sc. and Ph.D. Computer Science with answers and detailed solutions. Free sample questions below.

    What forces trees to exist

    Intuition

    What forces trees to exist

    A tree models any situation where each item has one parent and no chain of command loops back.

    The problem it solves

    Consider a company where every employee reports to exactly one manager and no manager is their own boss's boss. The reporting lines form a tree. The analogy breaks when an employee has two managers or when reporting loops exist, since trees forbid both.

    Our running example. Take a root r with children a, b, c. Let a have children d, e. Let b have child f. Node c is a leaf. The graph has seven vertices and six edges. It is connected and has no cycle, so it is a tree.

    The idea made exact

    A tree is an undirected graph that is connected and contains no cycle. A graph is connected when a path exists between every pair of vertices. A cycle is a closed walk with no repeated vertex except the start and end.

    Connectivity rules out scattered pieces. Acyclicity rules out loops. Together they force a single hierarchical structure with no redundancy.

    undirected graph connected acyclic

    Equivalent characterizations of trees

    Derivation

    Equivalent characterizations of trees

    For a graph G with n vertices and m edges, the following are equivalent: (T1) G is a tree. (T2) G is connected and . (T3) G is acyclic and . (T4) Every pair of vertices is joined by exactly one simple path.

    Prove (T1) implies (T2) by induction on n.

    assumption: undirected graph method: induction on n
    1. Base case n = 1. A single vertex has m = 0 edges. Then m = 1 - 1 holds. definition of edge count
    2. Leaf existence for n ≥ 2. Since G is connected, every vertex has degree at least one. Take a longest simple path v_0, v_1, ..., v_k. If v_k had a neighbor u not on the path, we would extend the path. If u were on the path, we would form a cycle. Both contradict our choice, so deg(v_k) = 1. maximality of path
    3. Remove the leaf. Delete v_k and its edge. The remaining graph G' has n - 1 vertices and m - 1 edges, and stays connected and acyclic. leaf removal preserves both properties
    4. Apply the hypothesis. By induction m - 1 = (n - 1) - 1, so m = n - 1. inductive step closes
    Result
    Check

    Our seven-node tree has six edges, and 6 = 7 - 1.

    Hierarchical Data Structures: Solved Questions with Step-by-Step Explanations (2 Problems)

    Question 1 · 2022 MSQ

    A ternary tree starts with a single root node at the top of the tree. Each node in the tree can have up to three nodes as its children. No node in the tree is the child of two different nodes. A node which has no children is called a leaf node.

    1. A.

    2. B.

    3. C.

    4. D.

    Question 2 · 2021 MSQ

    A binary tree starts with a single root node at the top of the tree. Each node can have either a left child or a right child, or both, or neither. The children of a node are drawn below it, connected by edges. Here are the five possible binary trees with three nodes.

    1. A.

      13

    2. B.

      15

    3. C.

      14

    4. D.

      30

    More previous year questions (pyqs) in this unit