
DS CCW
Quiz
•
Computers
•
University
•
Hard
Yaduraj Yaduraj
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following function in which start is pointing to the first node of the following linked list 1->2->3->4->5->6?
void fun(struct node* start)
{
if(start == NULL)
return;
printf("%d ", start->data);
if(start->next != NULL )
fun(start->next->next);
printf("%d ", start->data);
}
1 3 5
1 2 3 4
1 3 4 6
2 4 6
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Assume that the operators +,-,× are left associative and ^ is right associative. The order of precedence (from highest to lowest) is ^,x,+,-. The postfix expression corresponding to the infix expression a+b×c-d^e^f is
abc×+def^^-
abc×+de^f^-
ab+c×d-e^f^
-+a×bc^^def
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following function do for a given binary tree?
int fun(struct node *root)
{
if (root == NULL)
return 0;
if (root->left == NULL && root->right == NULL)
return 0;
return 1 + fun(root->left) + fun(root->right);
}
Counts leaf nodes
Counts internal nodes
Returns height where height is defined as number of edges on the path from root to deepest node
Return diameter where diameter is number of edges on the longest path between any two nodes.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Following is an incorrect pseudocode for the algorithm which is supposed to determine whether a sequence of parentheses is balanced.
declare a character stack
while ( more input is available)
{
read a character
if ( the character is a '(' )
push it on the stack
else if ( the character is a ')' and the stack is not empty )
pop a character off the stack
else
print "unbalanced" and exit
}
print "balanced"
Which of these unbalanced sequences does the above code think is balanced?
((())
())((
(()()))
(()))()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Suppose a circular queue of capacity (n–1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR=FRONT=0. The conditions to detect queue full and queue empty are
Full:(REAR+1)modn==FRONT,empty:REAR==FRONT
Full:(REAR+1)modn==FRONT,empty:(FRONT+1)modn==REAR
Full:REAR==FRONT,empty:(REAR+1)modn==FRONT
Full:(FRONT+1)modn==REAR,empty:REAR==FRONT
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many distinct binary search trees can be constructed out of 4 distinct keys?
5
14
24
35
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A Binary Search Tree is generated by inserting in order of the following integers. 50,15,62,5,20,58,91,3,8,37,60,24 The number of nodes in the left and right subtree of the root respectively is:
(4,7)
(7,4)
(8,3)
(3,8)
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple

Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
12 questions
JavaScript Quiz
Quiz
•
University
15 questions
Stacks and Queues Quiz
Quiz
•
University
15 questions
Day 1 - Deployment ...
Quiz
•
University
10 questions
Queues and Circular Queues
Quiz
•
University
6 questions
Elements in HTML
Quiz
•
University
10 questions
DSA-23-7-25
Quiz
•
University
10 questions
HTML Introduction
Quiz
•
3rd Grade - Professio...
13 questions
HTML тегтері
Quiz
•
1st Grade - University
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
Discover more resources for Computers
11 questions
NFL Football logos
Quiz
•
KG - Professional Dev...
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms
Quiz
•
11th Grade - University
38 questions
Unit 6 Key Terms
Quiz
•
11th Grade - University
20 questions
La Hora
Quiz
•
9th Grade - University
7 questions
Cell Transport
Interactive video
•
11th Grade - University
7 questions
What Is Narrative Writing?
Interactive video
•
4th Grade - University