Data Structure tree and graph

Data Structure tree and graph

University

15 Qs

quiz-placeholder

Similar activities

TIK KELAS 9

TIK KELAS 9

9th Grade - University

20 Qs

Struktur Data

Struktur Data

University

10 Qs

80-100

80-100

University

20 Qs

Machine Learning Quiz

Machine Learning Quiz

University

17 Qs

Kelas 7 - Halaman 12 (UH Bab 1)

Kelas 7 - Halaman 12 (UH Bab 1)

7th Grade - University

15 Qs

General ExpressJS Quiz

General ExpressJS Quiz

University

10 Qs

DSA (Quiz 4) - Trees

DSA (Quiz 4) - Trees

University

20 Qs

Binary Search Tree Quiz

Binary Search Tree Quiz

University

10 Qs

Data Structure tree and graph

Data Structure tree and graph

Assessment

Quiz

Information Technology (IT)

University

Hard

Created by

Arshad Ali

Used 2+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Convert the postfix expression,into its correct infix form.
Expression:876-4*/83*+4+5/

((8/((7−6)∗4))+(8∗3)+4)/5

(8/(7−(6∗4))+(8∗3)+4)/5(8 / (7 - (6 4)) + (8 3) + 4) / 5(8/(7−(6∗4))+(8∗3)+4)/5

(8/((7−6)/4)+8∗(3+4))/5

((8/(7−6))∗4+(8∗3)+4)/5

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the maximum number of nodes at level k in a binary tree?

  1. 2^k-1

  1. 2^k

  1. 2k

  1. k^2

3.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

Media Image

what will be the output of above code if the binary search tree values are [50 30 40 20 10 70 60 80 90]   low=30 and high=90


  1. [30,40,50,60,70,80]

  1. [80,70,60,50,40,30]

  1. [30,50,70,90]

  1. [40,60,80]

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

A social media platform wants to recommend friends to its users based on common interests. The platform represents users as nodes in a graph, and the friendships between users as edges. The recommendation algorithm aims to suggest friends who have a high number of mutual friends.Which algorithm is most suitable for recommending friends based on mutual friends in the graph?


  1. Breadth-first search (BFS)

  1. Depth-first search (DFS)

  1. Dijkstra's algorithm

Kruskal's algorithm

5.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Media Image

Given a BST(Binary Search Tree) with values 10,50,150,37,7 and minVal=-9999 maxVal=9999 what is the functionality of the following code

  1. Checks largest child node in the BST

  1. Checks the root element is maximum or minimum

  1. Checks all the BST values are within minVal to maxVal

  1. Checks the given BST is valid BST or not

6.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Media Image

Below code finds the Kth smallest number in the binary search tree. But the code contains small logical faults that prevent it from producing the required results. To obtain the output, correct the code


  1. condition:if (count != k) should be changed to if (count < k)

  1. condition:if (count != k) should be changed to if (count >=k)  

  1. condition:if (count != k) should be changed to if (count == k) 

  1. condition:if (count != k) should be changed to if (count > k)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens when the root node is deleted from a BST?

Tree becomes invalid

Only the left subtree survives

The entire tree is deleted

It must be replaced with a node from a subtree

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?