1. Home
  2. Explore
  3. Computer Science
  4. Binary Tree Fundamentals

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Binary Tree Fundamentals

  • 15Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Tree Types
In a full binary tree, any node that has children must have exactly
children.

15 questions

  1. 1
    In a full binary tree, any node that has children must have exactly
    _____
    children.
    Hint

    Think about the requirement that no node can have only one child.

    Answer

    two

  2. 2
    In a complete binary tree, nodes are filled in order: top to bottom and
    _____
    .
    Hint

    Consider how you would fill a tree level by level without gaps.

    Answer

    left to right

  3. 3
    A perfect binary tree is both complete and
    _____
    .
    Hint

    Think about the two properties combined: all leaves on same level and no nodes with only one child.

    Answer

    full

  4. 4
    In a perfect binary tree, all leaf nodes are on the same
    _____
    .
    Hint

    Consider the uniformity of depth for leaves.

    Answer

    level

  5. 5
    A binary heap is typically implemented as a
    _____
    binary tree.
    Hint

    Recall the structure requirement for efficient array representation.

    Answer

    complete

  6. 6
    In a pre-order traversal, the node is visited
    _____
    the left and right subtrees.
    Hint

    The prefix 'pre' indicates the node is visited first.

    Answer

    before

  7. 7
    In an in-order traversal, the node is visited
    _____
    the left subtree and before the right subtree.
    Hint

    The prefix 'in' suggests the node is visited in between the subtrees.

    Answer

    after

  8. 8
    In a post-order traversal, the node is visited
    _____
    the left and right subtrees.
    Hint

    The prefix 'post' means after.

    Answer

    after

  9. 9
    The prefix in the traversal name (pre, in, post) indicates when we
    _____
    the node.
    Hint

    Think about what action we perform on the node relative to subtrees.

    Answer

    visit

  10. 10
    In recursive tree traversal, the same
    _____
    is executed at each node.
    Hint

    Consider the set of steps performed at each node.

    Answer

    policy

  11. 11
    The state of recursion in a tree traversal is maintained on the
    _____
    .
    Hint

    Think about where function call information is stored.

    Answer

    call stack

  12. 12
    Recursion can be replaced by using an explicit
    _____
    data structure for iterative traversal.
    Hint

    Consider the data structure that mimics function call behavior.

    Answer

    stack

  13. 13
    A binary search tree has the property that all nodes in the left subtree are
    _____
    than the root.
    Hint

    Compare values relative to root.

    Answer

    less

  14. 14
    Performing an in-order traversal on a binary search tree yields nodes in
    _____
    order.
    Hint

    Think about the result of visiting left, node, right on a sorted structure.

    Answer

    increasing

  15. 15
    The time complexity of a traversal that visits all n nodes of a tree is
    _____
    .
    Hint

    Consider the relationship between number of nodes and operations.

    Answer

    O(n)

1 of 15
Question 1 of 15

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent