
Data Structure LAB VIVA 1

Quiz
•
Computers
•
University
•
Hard
Rejimoan R
Used 2+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
For getting best time complexity in the worst case scenario, which type of sorting algorithms are used?
Bubble sort of algorithm
Selection sort of algorithm
Quick sort of algorithm
Merge sort of algorithm
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four items and each element is inserted in a queue. The two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is
A
B
C
D
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the function f defined below.
struct item
{
int data;
struct item next;
};
int f(struct item p)
{
return (
(p == NULL) ||
(p->next == NULL) ||
(( p->data <= p->next->data) && f(p->next))
);
}
For a given linked list p, the function f returns 1 if and only if
not all elements in the list have the same data value.
the elements in the list are sorted in non-decreasing order of data value
the elements in the list are sorted in non-increasing order of data value
None of them
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following points is/are true about Linked List data structure when it is compared with array?
The size of array has to be pre-decided, linked lists can change their size any time.
It is easy to insert and delete elements in Linked List
Random access is not allowed in a typical implementation of Linked Lists
All of the above
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many stacks are needed to implement a queue. Consider the situation where no other data structure like arrays, linked list is available to you.
4
3
2
1
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A Priority-Queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is given below: 10, 8, 5, 3, 2 Two new elements ”1‘ and ”7‘ are inserted in the heap in that order. The level-order traversal of the heap after the insertion of the elements is:
10, 8, 7, 5, 3, 2, 1
10, 8, 7, 2, 3, 1, 5
10, 8, 7, 1, 2, 3, 5
10, 8, 7, 3, 2, 1, 5
7.
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) mod n == FRONT, empty: REAR == FRONT
Full: (REAR+1) mod n == FRONT, empty: (FRONT+1) mod n == REAR
Full: (FRONT+1) mod n == REAR, empty: REAR == FRONT
Full: REAR == FRONT, empty: (REAR+1) mod n == FRONT
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Data Structure

Quiz
•
University
20 questions
Data Structures Quiz

Quiz
•
University
14 questions
Binary Tree

Quiz
•
University
20 questions
Data Structures and Algorithm

Quiz
•
University
11 questions
Trees

Quiz
•
University
10 questions
Quiz - CSE

Quiz
•
University
20 questions
DSA - QA3

Quiz
•
University
15 questions
Binary Addition

Quiz
•
9th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University