Search Header Logo
Tree & Graph problems

Tree & Graph problems

Assessment

Presentation

Computers

Professional Development

Hard

Created by

PRADHEEBA U

Used 8+ times

FREE Resource

20 Slides • 5 Questions

1

Tree & Graph problems

From Data Structures

Slide image

2

Multiple Choice

Question image

Find the post-order Traversal

1

a) 6, 2, 5, 7, 11, 2, 5, 9, 4

2

b) 6, 5, 2, 11, 7, 4, 9, 5, 2

3

c) 2, 7, 2, 6, 5, 11, 5, 9, 4

4

d) 2, 7, 6, 5, 11, 2, 9, 5, 4

3

Multiple Choice

Question image

Find the left order traversal

1

a) 2, 7, 2, 6, 5, 11, 5, 9, 4

2

b) 2, 7, 5, 2, 11, 9, 6, 5, 4

3

c) 2, 5, 11, 6, 7, 4, 9, 5, 2

4

d) 2, 7, 5, 6, 11, 2, 5, 4, 9

4

Multiple Choice

Question image

For a particular tree, the in-order traversal is 6,2,8,7,11,2,5,9,4 and pre-order traversal is 2,7,2,6,8,11,5,9,4. Find the right child of the root.

1

5

2

7

3

2

4

8

5

BST

Insertion and Deletion

Slide image

6

Insertion

  • 10

  • 20

  • 30

  • 5

  • 2

  • 1

  • 6

    4

7

Lets see how the values get inserted

https://visualgo.net/en/bst

8

 Adelson, Velski & Landis Tree

Insertion and Deletion

Slide image

9

Insertion

  • 10

  • 20

  • 30

  • 40

  • 50

  • 5

  • 4
    2
    1

10

B- Tree

Insertion and Deletion

Slide image

11

Insertion with Max Deg 4

10
20
30
40
50
60
15
35
38
39
52

12

Let's see the insertion... 

https://www.cs.usfca.edu/~galles/visualization/BTree.html

13

Graph 

Traversal Topologoical Sort

Slide image

14

BFS & DFS 

Along with topological sort

Slide image

15

Lets see the solution.. 

https://visualgo.net/en/dfsbfs

16

Heap Tree

Min and Max

Slide image

17

Insert and Extract in Heap 

10
20
30
45
48
19
25
35
27

18

How to insert ? how extraction done?

https://visualgo.net/en/heap

19

Lets check the understandability of DS

There are 7 systems (0,..,6) connected as given in the figure.What is the minimum number of connections to be added to the network so that when a system goes down, the rest of the network is still connected ?

Slide image

20

How many Articulation points are available in this graph? How? 

0

1
2
3

Slide image

21

Multiple Choice

The leaf of an expand is never an articulate point

1

True

2

False

3

Cannot be Determined

22

Multiple Choice

Correct choice of data structures can improve the performance of algorithms. Match the following algorithms with appropriate data structures,


i. Breadth first search

ii. Depth first search

iii. Sorting


a. Heap

b. Stack

c. Queue

1

A. i­a ii­b iii­c

2

B. i­b ii­a iii­c

3

C. i­c ii­b iii­a

4

D. i­b ii­c iii­a

23

Which of the following the graph posses? How?

a) Euler Circuit
b) Euler Path

Slide image

24

Quickly decide if its eulerian.

Give Reasons

Slide image

25

Find if it has Euler Path or not

If it has, how many edges are required to be added, to make this an euler circuit?

Slide image

Tree & Graph problems

From Data Structures

Slide image

Show answer

Auto Play

Slide 1 / 25

SLIDE