
DS CCW
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Yaduraj Yaduraj
Used 2+ times
FREE Resource
Enhance your content in a minute
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)
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
10 questions
Server Administration- Quiz 1
Quiz
•
12th Grade - University
11 questions
Computer Science (1-9) - Identifying & Preventing Threats
Quiz
•
University
10 questions
Teste python- Unesp-Jaboticabal
Quiz
•
University
15 questions
07 - Map
Quiz
•
University
14 questions
IOTA : Web Development Bootcamp Quiz 2
Quiz
•
University
10 questions
BOOLEAN CLUB QUIZ 1
Quiz
•
University
10 questions
Concept of Computer Network
Quiz
•
University
12 questions
PSSI Chp 1 dan 2
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
