Trees and Graphs

38 MCQs Covers root, leaf, edge, height and balanced trees, tree traversals and tree applications. Also covers vertices, edges, degree, weight, directed vs undirected graphs, BFS, and tree vs graph.

MCQs

38 questions · 35 min · 38 marks

Want to try first? Take the free Computer Science test: SDLC and Waterfall Model

Sample questions

The first 5 of 38. Try each one, then tap to see the answer.

  1. Question 1

    What is the top node in a tree called?

    • ALeaf
    • BRoot
    • CBranch
    • DParent
    Show answer

    Answer: B

    The root is the topmost node.

  2. Question 2

    What are the connections between nodes in a tree called?

    • ANodes
    • BLinks
    • CPaths
    • DEdges
    Show answer

    Answer: D

    An edge connects two nodes.

  3. Question 3

    What is a node with no children called?

    • ALeaf
    • BRoot
    • CBranch
    • DParent
    Show answer

    Answer: A

    A leaf has no children.

  4. Question 4

    What does the height of a tree represent?

    • ANumber of leaves
    • BPath to root
    • CDepth of the tree
    • DNumber of nodes
    Show answer

    Answer: C

    Height shows how deep the tree is.

  5. Question 5

    In which type of tree is the height difference of subtrees minimal?

    • ABinary Tree
    • BBalanced Tree
    • CUnbalanced Tree
    • DSearch Tree
    Show answer

    Answer: B

    Balanced trees have almost equal left and right heights.

More tests in Computational Structures

Practise with a free account

Save your scores, see which chapters need work, and keep a notebook of every question you got wrong.

Create free account