# Ds Lab Quiz Final

15 Questions | Total Attempts: 44  Settings Create your own Quiz • 1.
........ is a type of tree in which left sub tree height differs from right sub tree height by at most 1
• A.

Binary Search tree

• B.

AVL Tree

• C.

B-Tree

• D.

Red Black Tree

• 2.
Merge sort has time complexity
• A.

O (log n)

• B.

O(n log n)

• C.

O(n)

• D.

O(n2)

• 3.
The depth of Complete Binary tree is
• A.

N log n

• B.

N log n +1

• C.

Log n

• D.

Log n +1

• 4.
One can convert a binary search tree into its mirror image by traversing it in
• A.

Inorder

• B.

Preorder

• C.

Postorder

• D.

None of the above

• 5.
Overflow condition for circular queue is
• A.

Front=Max-1

• B.

Rear= Max-1

• C.

Front = 0 and Rear = Max-1

• D.

Front = Max-1 and Rear = 0

• 6.
Prefix expression for the given infix expression is:(A + B) * C + D / (E + F * G) - H
• A.

A B + C * D E F G * + / + H -

• B.

A B *C + D E F G * + / + H -

• C.

A B + C * D E F G * + +/ H -

• D.

A B + C * D E F G * + / + -H

• 7.
Int foo(int n1, int n2); int main() { int n1, n2; printf("Enter two positive integers: "); scanf("%d %d", &n1, &n2); printf("%d and %d is %d.", n1, n2, foo(n1,n2)); return 0; } int foo(int n1, int n2) { if (n2 != 0) return foo(n2, n1%n2); else return n1; } The function foo determines:
• A.

GCD

• B.

LCM

• C.

Factorial

• D.

Factors

• 8.
Static void find(struct Node** head_ref){    struct Node* prev   = NULL;    struct Node* current = *head_ref;    struct Node* next;    while (current != NULL)    {        next  = current->next;          current->next = prev;           prev = current;        current = next;    }    *head_ref = prev;}What does the above function does?
• A.

Exchange the values of simultaneous node in list

• B.

Points the last node to first

• C.

Reverses a linked list

• D.

None

• 9.
Breadth First Traversal Technique uses
• A.

Queue

• B.

Stack

• C.

• D.

Array

• 10.
What will be the output of the following program?#include <stdlib.h> #include <stdio.h> enum {false, true}; int main() { int i = 1; do { printf("%d\n", i); i++; if (i < 15) continue; } while (false); getchar(); return 0; }
• A.

1

• B.

14

• C.

15

• D.

13

• 11.
Depth First Search uses
• A.

Stack

• B.

Queue

• C.

Array

• D.

• 12.
A B tree node of order n has ..... children
• A.

N

• B.

N-2

• C.

N-1

• D.

2*n

• 13.
Predict the output of below program.int main(){  int x, y = 5, z = 5;  x = y==z;  printf("%d", x);     getchar();  return 0;}
• A.

5

• B.

0

• C.

1

• D.

Can't Predict

• 14.
Worst case time complexity for quicksort is:
• A.

O(n2)

• B.

O(n log n)

• C.

O(n3)

• D.

O(n)

• 15.
In case of simple linear queue, if front =0 and Rear = Max-1, then, queue is full?
• A.

True

• B.

False

Related Topics Back to top
×

Wait!
Here's an interesting quiz for you.