Back to marketplace

Chapter 39 - Trees

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

What does a rooted tree have?

Back (Answer)

» Has a root » Branches » Leaves

#2
Front (Question)

What are the differences between a tree in computer science and real life?

Back (Answer)

» In computer science has its root at the top and its leaves at the bottom

#3
Front (Question)

What are the typical uses for rooted trees?

Back (Answer)

» Manipulating hierarchial data » Manipulated sorted lists of data » Making information easy to search

#4
Front (Question)

What is a tree?

Back (Answer)

» A tree is a fundamental data structure » Consists of nodes and pointers

#5
Front (Question)

What does each tree have?

Back (Answer)

» A root node

#6
Front (Question)

What are the leaf nodes?

Back (Answer)

» Nodes at the very bottom of the tree » And a node which has no children

#7
Front (Question)

What are nodes connected with?

Back (Answer)

» Pointers also known as edges

#8
Front (Question)

What is a subtree?

Back (Answer)

» A set of nodes and edges from any single node down through all of its descendants is known as a subtree

#9
Front (Question)

What does each edge connect?

Back (Answer)

» 2 nodes » Evert node except the root is connect by exactly one edge from another node

#10
Front (Question)

What is the root?

Back (Answer)

» Only root which has no incoming edges

#11
Front (Question)

What is the child ?

Back (Answer)

» The set of nodes that have incoming edges from the same node

#12
Front (Question)

What is a binary tree?

Back (Answer)

» Similar to a standard rooted tree » In which eah node has a maximum of 2 children

#13
Front (Question)

What is a binary tree?

Back (Answer)

» Similar to a standard rooted tree » In which eah node has a maximum of 2 children

#14
Front (Question)

How can binary trees be represented in memory?

Back (Answer)

» As dicitonaries

#15
Front (Question)

What are the values of the right pointer/ left pointer if there is no child node?

Back (Answer)

» Null

#16
Front (Question)

What are the applications of binary trees?

Back (Answer)

» Database applications where efficient searching is required » Wireless networking and routing tables

#17
Front (Question)

What does each node in a binary tree contain?

Back (Answer)

» A left pointer » A right pointer » Data

#18
Front (Question)

What are the steps to add an item to a binary tree?

Back (Answer)

» Check if there is free memory for the node - if there isn’t output an error » Create a new node and insert data into it

#19
Front (Question)

What happens if the binary tree is empty when data is being added to it?

Back (Answer)

» New node becomes first item - create a start pointer to it

#20
Front (Question)

What happens if the binary tree is not empty, when trying to add an item to a binary tree?

Back (Answer)

» Start at root node » If new node should be placed before the current node, follow the left pointer » If new should be placed after the current node, follow the right pointer » Repeat until the leaf node is reached » Set right pointer of the previous node

#21
Front (Question)

How can we find the item we want to delete from the binary tree?

Back (Answer)

» Start at the root node and set it as the current node » While the current node exists and is not the one to be deleted: » If item to be deleted is < than the current node, follow the left pointer, if > follow the right pointer

#22
Front (Question)

What are the steps to remove an item from a binary tree if the node has no children?

Back (Answer)

» If the previous node is greater than the current node, previous node’s left pointer is set to null » Else, the previous node’s right pointer is set to null

#23
Front (Question)

What is the Hibbard deletion algorithm?

Back (Answer)

» To delete a node, we find the smallest value in the right sub-tree(Sucessor) » And move it the position occupied by G » Smalles value in the right - sub tree will always be left-most node in the right sub tree

#24
Front (Question)

What are the problems with the Hibbard delete program?

Back (Answer)

» Tree may become unbalanced, as any node can become the root node.