wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quantitative Aptitude Series

Total questions: 20

Worksheet time: 20mins

Name
Class
Date
1.

Which of the following is not a valid declaration in C?

1.short int x;

2.signed short x;

3.short x;

4.unsigned short x;

a)

3 and 4

b)

1

c)

2

d)

All are valid

2.

void swap ( int x, int y )

{

int tmp;

tmp = x;

x = y;

y = tmp;

}

Ques: In order to exchange the values of two variables a and b:

a)

Call swap (a, b)

b)

Call swap (&a, &b)

c)

swap(a, b) cannot be used as it does not return any value

d)

swap(a, b) cannot be used as the parameters passed by value

3.

What will be the output of the following code?

#include

int main()

{

int any = ' ' * 10;

printf("%d", any);

return 0;

}

a)

340

b)

320

c)

300

d)

360

4.

Predict the output of the following pseudo-code?

int main()

{

float i;

i = 1;

printf("%d",i);

return 0;

}

a)

1.000000

b)

1

c)

Error

d)

Garbage Value

5.

Predict the Output for the following code?

int main()

{

typedef int num;

num bunk = 0.00;

printf("%d", bunk);

return 0;

}

a)

0.0

b)

0

c)

logical Error

d)

None

6.

What is the time complexity for the following code

sum =0

for(i=1;i<=n;i*=2)

for(j=1;j<=n;j++)

sum++;

a)

O(n^2)

b)

O(nlogn)

c)

O(n)

d)

O(n(logn(logn)))

7.

Consider the following functions from positive integers t real numbers

10 , √n , n , log₂(n) ,100/n;

The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is:

a)

log₂(n),100/n,10,√n,n

b)

100/n,10,log₂(n), √n,n

c)

10,100/n,√n,log₂(n),n

d)

l00/n,log₂(n),10,√n,n

8.

.Which of the following sorting algorithms provide the best time complexity in the worst-case scenario?

a)

Merge Sort

b)

Quick Sort

c)

Bubble Sort

d)

Selection Sort

9.

In the linked list implementation of queue, where will the new element be inserted?

a)

At the middle position of the linked list

b)

At the head position of the linked list

c)

At the tail position of the linked list

d)

None of the above

10.

In the Deque implementation using singly linked list, what would be the time complexity of deleting an element from the rear end?

a)

O(1)

b)

O(n2)

c)

O(n)

d)

O(nlogn)

11.

In a circular queue implementation using array of size 5, the array index starts with 0 where front and rear values are 3 and 4 respectively.

Determine the array index at which the insertion of the next element will take place.

a)

5

b)

0

c)

1

d)

2

12.

What would be the output after performing the following operations in a Deque?

Insertfront(10);

Insertfront(20);

Insertrear(30);

Insertrear(40);

Deletefront();

Insertfront(50);

Deleterear();

Display();

a)

10, 20, 30

b)

50, 10, 30

c)

40, 20, 30

d)

None of the above

13.

Time complexity of merge sort is

a)

O(logn)

b)

O(nlogn)

c)

O(n)

d)

O(n^2)

14.

Time complexity of insertion sort algorithm in best case is

a)

O(logn)

b)

O(nlogn)

c)

O(n)

d)

O(n^2)

15.

What is the time complexity for the following code

for (int i = 2; i * i <= N; i++) {

if (N % i == 0) {

isPrime = false;

}

}

a)

O(n^2)

b)

O(nlogn)

c)

O(√n)

d)

O(n)

16.

The number of edges from the root to the node is called _______ of the tree.

a)

Height

b)

Depth

c)

Length

d)

Width

17.

What is the average case time complexity for finding the height of the binary tree ?

a)

O(log log n)

b)

O(n log n)

c)

O(n)

d)

O(log n)

18.

A binary tree in which all the leaves are on the same level is called as :

a)

Complete binary tree

b)

Strictly binary tree

c)

Binary Search tree

d)

Full Binary tree

19.

Which one of the following is an application of Stack Data Structure?

a)

Managing function calls

b)

The stock span problem

c)

Arithmetic expression evaluation

d)

All of the above

20.

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