Search Header Logo
DCS2101 - Week 10 (Trees)

DCS2101 - Week 10 (Trees)

Assessment

Presentation

Computers

University

Practice Problem

Medium

Created by

Yasmin Basiran

Used 1+ times

FREE Resource

39 Slides • 14 Questions

1

media

2

media

3

Multiple Select

If you had to organize 100 candies in such a way that you can always find your favorite one really fast — would you:

1

Pile them randomly

2

Sort them neatly in one line

3

Arrange them in a branching candy tree

4

media

5

media

6

media

7

media

8

media

9

media

10

media

11

Open Ended

What are some real-life examples of hierarchical structures that can be represented as trees?

12

media

13

media

14

media

15

media

16

media

17

media

18

media

19

media

20

media

21

media

22

media

23

Multiple Choice

What does BST stand for?

1
Binary Search Technique
2
Binary Search Tree
3
Basic Sorting Tree
4
Balanced Search Tree

24

Multiple Choice

The topmost node of a tree is called the:

1
leaf
2
branch
3
trunk
4
root

25

Multiple Choice

How many children can a node have in a binary tree?

1
4
2
3
3
1
4
2

26

Open Ended

If your phone’s folders and apps were organized as a tree, who would be the root node and what would the leaves represent?

27

media

28

media

29

media

30

media

31

media

32

media

33

media

34

media

35

Multiple Choice

In a BST, where are all smaller elements found?

1
All smaller elements are found in the right subtree.
2
All smaller elements are found at the root.
3
All smaller elements are found in a separate list.
4
All smaller elements are found in the left subtree.

36

Multiple Choice

Which traversal visits the root last?

1
Post-order traversal
2
Level-order traversal
3
Pre-order traversal
4
In-order traversal

37

Multiple Choice

What is the inorder traversal for: 5 → left 3, right 7?

1
5, 3, 7
2
3, 5, 7
3
3, 7, 5
4
7, 5, 3

38

Multiple Choice

If a BST has 7 nodes, how many edges does it have?

1
6
2
8
3
7
4
5

39

media

40

media

41

media

42

media

43

media

44

media

45

media

46

media

47

Multiple Choice

When deleting a node with one child, we:

1
Promote the child to the parent node.
2
Replace the node with a null value.
3
Delete the node without any changes.
4
Replace the node with its child.

48

Multiple Choice

In BST deletion, if the node has two children, we replace it with:

1
the node itself
2
the left child
3
the right child
4

in-order successor

49

Draw

Draw a Binary Search Tree for the values:
8, 3, 10, 1, 6, 14, 4, 7

50

Draw

Given this BST:

12

/ \

8 15

/ \ \

5 10 20

What happens when you delete 8?

51

media

52

And now a word from our sponsor...

media

53

media
media

Show answer

Auto Play

Slide 1 / 53

SLIDE