wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Data Structures Priliminary

Total questions: 30

Worksheet time: 30mins

Name
Class
Date
1.

If the insertion and deletion happens from both the ends then the queue is called a______Queue

a)

a) Deque

b)

b) Header

c)

c) Queue

d)

d) Circular Queue

2.

Match the following.


a) Completeness i) How long does it take to find a solution

b) Time Complexity ii) How much memory need to perform the search.

c) Space Complexity iii) Is the strategy guaranteed to find the solution when there in one.

a)

a-iii, b-ii, c-i

b)

a-i, b-ii, c-iii

c)

a-iii, b-i, c-ii

d)

a-i, b-iii, c-ii

3.

Efficiency of an algorithm is measured by

a)

Time and Capacity complexity

b)

Time and Space complexity

c)

Speed and Space complexity

d)

Speed and Capacity complexity

4.

If for an algorithm time complexity is given by O(1) then complexityof it is:

a)

A. constant

b)

B. polynomial

c)

C. exponential

d)

D. none of the mentioned

5.

int nums[ ] =

{2, 3, 5, 8, 9, 11};

How would you access the fourth element in nums

a)

nums[8]

b)

nums[3]

c)

nums(4)

d)

nums(3)

6.

Consider the following operation performed on a stack of size 5.


Push(1);

Pop();

Push(2);

Push(3);

Pop();

Push(4);

Pop();

Pop();

Push(5);


After the completion of all operation, get the total number of element present in stack is

a)

1

b)

2

c)

3

d)

4

7.

____________data structures are those whose sizes and structures associated memory locations are fixed at compile time.

a)

linear

b)

homogeneous

c)

static

d)

dynamic

8.

In a stack, if a user tries to remove an element from empty stack it is called _________

a)

Underflow

b)

Stack is Empty

c)

Overflow

d)

None of the above

9.

Pushing an element into stack already having five elements and stack size of 5, then stack becomes

a)

Overflow

b)

Crash

c)

Underflow

d)

None of the above

10.

What will be the postfix form of the above expression -

(A+B)∗(C∗D-E)∗F/G

a)

None of these

b)

A B + C D ∗ E − F G ∗ / ∗

c)

A B + C D E ∗ − F G / ∗ ∗

d)

A B + C D ∗ E − F G / ∗ ∗

11.

Linked lists are not suitable to for the implementation of?

a)

Insertion sort

b)

Radix sort

c)

Polynomial manipulation

d)

Binary search

12.

Linked list is considered as an example of ___________ type of memory allocation.

a)

Dynamic

b)

Static

c)

Compile time

d)

None of the mentioned

13.

How do you initialize an array in C?

a)

int arr[3] = (1,2,3);

b)

int arr(3) = {1,2,3};

c)

int arr[3] = {1,2,3};

d)

int arr(3) = (1,2,3);

14.

Which of the given options provides the increasing order of asymptotic complexity of functions f1, f2, f3 and f4?

f1(n) = 2^n

f2(n) = n^(3/2)

f3(n) = nLogn

f4(n) = n^(Logn)

a)

f3, f2, f4, f1

b)

f3, f2, f1, f4

c)

f2, f3, f1, f4

d)

f2, f3, f4, f1

15.

The time complexity of the following C function is (assume n > 0)

int recursive (int n) {

if(n == 1)

return (1);

else

return (recursive (n-1) + recursive (n-1));

}

a)

O(n)

b)

O(n log n)

c)

O(n^2)

d)

O(2^n)

16.

What advantage does a linked list have over an array?

a)

Size of the list doesn't need to be mentioned at the beginning of the program

b)

You can add or remove elements from the middle of the list.

c)

The linked list doesn't have a size limit

d)

All of these are true.

17.

How to delete node B?

a)

head->next=TempPtr; free(TemPtr);

b)

free(TemPtr); head->next=TempPtr->next;

c)

head->next=TempPtr->next;free(TemPtr)r;

d)

free(head); head->next= TempPtr->next

18.

How many null pointers exists in a circular linked list?

a)

0

b)

1

c)

2

d)

3

19.

Which node’s data will be printed when


“temp =temp->next” is executed 3 times and the initial value of temp is temp=head

a)

Null

b)

9

c)

27

d)

46

20.

What is the other name for a postfix expression?

a)

a) Normal polish Notation

b)

b) Reverse polish Notation

c)

c) Warsaw notation

d)

d) Infix notation

21.

The result evaluating the postfix expression 10 5 + 60 6 / * 8 – is

a)

284

b)

213

c)

142

d)

71

22.
for(int i=0; i<10; i++)
           numbers[i] = 2 * i + 1;
// Which index of the array holds the value of 5?
a)
1
b)
2
c)
3
d)
4
23.

In Linked list implementation, a node carries information regarding _______.

a)

Data

b)

Link

c)

Data and Link

d)

Node

24.

Convert the following Infix expression to Postfix form using a stack


x + y * z + (p * q + r) * s

a)

xyz*+pq*r+s*+

b)

xyz*+pq*r+s+*

c)

xyz+*pq*r+s*+

d)

none

25.

Mathematical-model with a collection of operations defined on that model is called

a)

Data Structure

b)

Abstract Data Type

c)

Primitive Data Type

d)

Algorithm

26.

Which header file is required to use Dynamic Memory Allocation functions

a)

stdio

b)

stdlib

c)

conio

d)

stdutil

27.

calloc() function takes :

a)

One parameter

b)

Two parameters

c)

Two parameters but one is optional

d)

Zero parameters

28.

Consider the following definition in c programming language.Which of the following c code is used to create new node?

struct node

{

int data;

struct node * next;

}

typedef struct node NODE;

NODE *ptr;

a)

ptr = (NODE*)malloc(sizeof(NODE));

b)

ptr = (NODE*)malloc(NODE);

c)

ptr = (NODE*)malloc(sizeof(NODE*));

d)

ptr = (NODE)malloc(sizeof(NODE));

29.

What is a portion of memory from which space is automatically allocated or de-allocated as required?

a)

Static data structure

b)

Dynamic data structure

c)

Heap

d)

Encapsulation

30.

What is a variation of a FIFO structure where some data may leave out a sequence where it has a higher priority than other data items?

a)

Linear queue

b)

Circular queue

c)

Priority queue

d)

Heap