wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

EC8393_FDS_MODEL_EXAM_1_PART A

Total questions: 30

Worksheet time: 30mins

Name
Class
Date
1.

Where is linear searching used?

a)

When the list has only a few elements

b)

When performing a single search in an unordered list

c)

Used all the time

d)

When the list has only a few elements and When performing a single search in an unordered list

2.

What is the best case for linear search?

a)

O(nlogn)

b)

O(logn)

c)

O(n)

d)

O(1)

3.

What is the best case and worst case complexity of ordered linear search?

a)

O(nlogn), O(logn)

b)

O(logn), O(nlogn)

c)

O(n), O(1)

d)

O(1), O(n)

4.

What is the advantage of recursive approach than an iterative approach?

a)

Consumes less memory

b)

Less code and easy to implement

c)

Consumes more memory

d)

More code has to be written

5.

Binary Search can be categorized into which of the following?

a)

Brute Force technique

b)

Divide and conquer

c)

Greedy algorithm

d)

Dynamic programming

6.

What is the time complexity of binary search with iteration?

a)

O(nlogn)

b)

O(logn)

c)

O(n)

d)

O(n2)

7.

What is an external sorting algorithm?

a)

Algorithm that uses tape or disk during the sort

b)

Algorithm that uses main memory during the sort

c)

Algorithm that involves swapping

d)

Algorithm that are considered ‘in place’

8.

What is the worst case complexity of bubble sort?

a)

O(nlogn)

b)

O(logn)

c)

O(n)

d)

O(n2)

9.

Which of the following sorting algorithms is the fastest?

a)

Merge sort

b)

Quick sort

c)

Insertion sort

d)

Shell sort

10.

Which of the following methods is the most effective for picking the pivot element?

a)

first element

b)

last element

c)

median-of-three partitioning

d)

random element

11.

If several elements are competing for the same bucket in the hash table, what is it called?

a)

Diffusion

b)

Replication

c)

Collision

d)

Duplication

12.

What is a hash function?

a)

A function has allocated memory to keys

b)

A function that computes the location of the key in the array

c)

A function that creates an array

d)

A function that computes the location of the values in the array

13.

Which of the following is not a collision resolution strategy for open addressing?

a)

Linear probing

b)

Quadratic probing

c)

Double hashing

d)

Rehashing

14.

Which scheme uses a randomization approach?

a)

hashing by division

b)

hashing by multiplication

c)

universal hashing

d)

open addressing

15.

What is the maximum number of children that a binary tree node can have?

a)

0

b)

1

c)

2

d)

3

16.

How many common operations are performed in a binary tree?

a)

2

b)

3

c)

4

d)

5

17.

General ordered tree can be encoded into binary trees.

a)

True

b)

False

18.

If binary trees are represented in arrays, what formula can be used to locate a left child, if the node has an index i?

a)

2i+1

b)

2i+2

c)

2i

d)

4i

19.

What is the speciality about the inorder traversal of a binary search tree?

a)

It traverses in a non increasing order

b)

It traverses in an increasing order

c)

It traverses in a random fashion

d)

None of the mentioned

20.

What does the following piece of code do?

public void func(Tree root)

{

func(root.left());

func(root.right());

System.out.println(root.data());

}

a)

Preorder traversal

b)

Inorder traversal

c)

Postorder traversal

d)

Level order traversal

21.

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

a)

Height

b)

Depth

c)

Length

d)

Width

22.

What is a full binary tree?

a)

Each node has exactly zero or two children

b)

Each node has exactly two children

c)

All the leaves are at the same level

d)

Each node has exactly one or two children

23.

What data structures are used to implement BFS and DFS respectively?

a)

Linked Lists and Stacks

b)

Queues and Stacks

c)

Stacks and Queues

d)

All of the above

24.

What strategies are used in BFS and DFS traversals respectively?

a)

Level by level and depth wise

b)

Depth wise and level by level

c)

Children before siblings and siblings before children

d)

Siblings before children and children before siblings

25.

Which of these operators have the highest order of precedence?

a)

‘(‘ and ‘)’

b)

‘*’ and ‘/’

c)

‘~’ and ‘^’

d)

‘+’ and ‘-‘

26.

While evaluating a postfix expression, when an operator is encountered, what is the correct operation to be performed?

a)

push it directly on to the stack

b)

pop 2 operands, evaluate them and push the result on to the stack

c)

pop the entire stack

d)

ignore the operator

27.

Which of the following is not an application of stack?

a)

evaluation of postfix expression

b)

conversion of infix to postfix expression

c)

balancing symbols

d)

line at ticket counter

28.

The data structure required to check whether an expression contains balanced parenthesis is?

a)

Stack

b)

Queue

c)

Array

d)

Tree

29.

The postfix form of A*B+C/D is?

a)

*AB/CD+

b)

AB*CD/+

c)

A*BC+/D

d)

ABCD+/*

30.

Which data structure is used for implementing recursion?

a)

Queue

b)

Stack

c)

Array

d)

List