wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Hackathon Quiz 22-03-2020

Total questions: 5

Worksheet time: 5mins

Name
Class
Date
1.

Quick Sort uses ______________ technique

a)

interchange

b)

divide and conquer

c)

O(log n)

2.

What does the following function do for a given Linked List with first node as head?

void fun1(struct node* head)

{

if(head == NULL)

return;

fun1(head->next);

printf("%d ", head->data);

}

a)

Prints all nodes of linked lists

b)

Prints all nodes of linked list in reverse order

c)

Prints alternate nodes of Linked List

d)

Prints alternate nodes in reverse order

3.

Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?

a)

Insertion Sort

b)

Quick Sort

c)

Heap Sort

d)

Merge Sort

4.

What does the following piece of code do?


for(int i = 0; i < row; i++)

{

for(int j = 0; j < column; j++)

{

if(i == j)

sum = sum + (array[i][j]);

}

}

System.out.println(sum);

a)

normal of a matrix

b)

trace of a matrix

c)

square of a matrix

d)

transpose of a matrix

5.

Which data structure can be used to test a palindrome?

a)

tree

b)

heap

c)

stack

d)

priority queue