
DS CCW
Authored by Yaduraj Yaduraj
Computers
University
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
15 questions
Digital Etiquette
Quiz
•
4th Grade - University
15 questions
Data Mining - Classification Mining
Quiz
•
University
10 questions
Què has après sobre el web ?
Quiz
•
University
15 questions
PROBLEM SOLVING USING R UNIT I MCQS
Quiz
•
University
11 questions
C#. Знакомство с ООП и WindowsForms
Quiz
•
1st Grade - Professio...
10 questions
Lenguaje Perl
Quiz
•
University
9 questions
CHAPTER 5 ONLINE QUIZ
Quiz
•
University
12 questions
Javascript
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade
Discover more resources for Computers
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
20 questions
Endocrine System
Quiz
•
University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
30 questions
W25: PSYCH 250 - Exam 2 Practice
Quiz
•
University
5 questions
Inherited and Acquired Traits of Animals
Interactive video
•
4th Grade - University
20 questions
Implicit vs. Explicit
Quiz
•
6th Grade - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University
38 questions
Unit 8 Review - Absolutism & Revolution
Quiz
•
10th Grade - University