Back to marketplace

Trees

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

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

Card preview (22)

#1
Front (Question)

Define a tree

Back (Answer)

A connected undirected graph with no cycles

#2
Front (Question)

Define a cycle

Back (Answer)

A path which starts and ends at the same node

#3
Front (Question)

Define connected in the frame of trees

Back (Answer)

There’s a path from any node to another node and there’s no node disconnected from others

#4
Front (Question)

Define undirected in the frame of trees

Back (Answer)

There is no direction associated with an edge

#5
Front (Question)

What’s the root of a tree?

Back (Answer)

The start node for traversals

#6
Front (Question)

What is a tree called if it has a root?

Back (Answer)

A rooted tree

#7
Front (Question)

What is a branch?

Back (Answer)

A path from the root to an end point

#8
Front (Question)

What is the end point of a branch called?

Back (Answer)

A leaf

#9
Front (Question)

What does the height of a tree describe?

Back (Answer)

The number of edges that connect the root node to the leaf node that is furthest away

#10
Front (Question)

What is the E, N equation?

Back (Answer)

E (number of edges) = N (number of nodes) -1

#11
Front (Question)

How are nodes connected in a rooted tree?

Back (Answer)

By parent-child relationships

#12
Front (Question)

What is a binary tree?

Back (Answer)

A rooted tree where every node has at most 2 child nodes

#13
Front (Question)

Why is a binary search tree different from a rooted tree?

Back (Answer)

It’s ordered to optimise searching

#14
Front (Question)

Describe a binary search tree

Back (Answer)

A rooted tree where the nodes of a tree are ordered If the orders ascending the left nodes have values lower than the root and the right higher

#15
Front (Question)

How does an expression tree work?

Back (Answer)

Leaf nodes contain operands and other nodes contain operators

#16
Front (Question)

What are binary trees used for?

Back (Answer)

Used in compilers to build syntax trees Used in routers to store routing tables Speed up searching

#17
Front (Question)

What are expression trees used for?

Back (Answer)

Representing algebraic and Boolean expressions

#18
Front (Question)

What 2 ways can all trees be implemented?

Back (Answer)

As an adjacency matrix or adjacency list

#19
Front (Question)

What other way can a binary tree be implemented?

Back (Answer)

An array of records

#20
Front (Question)

Define the term Pre-order in traversals

Back (Answer)

Specifies the point in the traversal at which the node content is processed

#21
Front (Question)

How does a pre-order traversal work?

Back (Answer)

Each node is visited before the algorithm traverses either of the nodes subtrees

#22
Front (Question)

What is the simplified recursive algorithm for left-right pre-order traversal?

Back (Answer)

Visit the node Do a pre-order traversal of the nodes left subtree Do a pre-order traversal of the node’s right subtree