Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Data Structure Quiz1

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

Example of linear data structure except

a)

array

b)

tree

c)

queue

d)

stack

2.

It use pointer to link nodes.

a)

Variable

b)

Link List

c)

Pointer

d)

Trees

3.
_________________ is a collection of elements used to store the same type of data.
a)
Array
b)
Switch
c)
Case
d)
Loop
4.

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)

5.
Storage for data defined in terms of set of operations to be performed on the data 
a)
Arrays
b)
Variables
c)
Abstract Data Types
d)
Algorithms
6.
a)

circular linked list

b)

linked list

c)

doubly circular linked list

d)

doubly linked list

7.

int is __________ data type.

a)

user defined

b)

derived

c)

primary

d)

all of above

8.

Array is ___________ data type.

a)

user defined

b)

primary

c)

derived

d)

all of above

9.

In ____________ data structure, the data items are arranged in a linear sequence.

a)

linear

b)

non linear

c)

both a and b

d)

all of above

10.

In ___________ data structure data items are not in sequence.

a)

non linear

b)

linear

c)

non-homogeneous

d)

all of above

11.

A function calls itself is called ___________.

a)

queue

b)

recursion

c)

function

d)

none of above

12.

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)

a) Prints all nodes of linked lists

b)

b) Prints all nodes of linked list in reverse order

c)

c) Prints alternate nodes of Linked List

d)

d) Prints alternate nodes in reverse order

13.

What do you call a collection of items stored at contiguous memory locations?

a)

Linked List

b)

Linear List

c)

Array

d)

Data Structure

14.

A (a)   is a linear data structure, in which elements are not stored at contiguous memory locations.

15.

(a)   is defined as a mathematical model with a collection of operations defined on that model.

16.

Routine to delete element in an array implementation of List

a)

for(i=pos-1;i<n-1;i++)

list[i]=list[i-1];

b)

for(i=pos-1;i<n-1;i++)

list[i]=list[i*1];

c)

for(i=pos-1;i<n-1;i++)

list[i]=list[i+1];

d)

for(i=pos-1;i<n-1;i++)

list[i]=list[i+2];

17.

Give syntax to create a node for Single linked list?

a)

newnode=(struct node *)malloc(sizeof(struct node*));

b)

newnode=(struct node )malloc(sizeof(struct node));

c)

newnode=(struct node *)malloc(sizeof(struct node));

d)

newnode=(struct node )malloc(sizeof(struct node*));

18.

How to insert a node after a position P in singly linked list?

a)

Newnode -> data = P ;

Newnode -> next = p ->next ;

P -> next = newnode ;

b)

Newnode -> data = x ;

Newnode -> next = p ->next ;

P -> next = L ;

c)

Newnode -> data = x ;

Newnode -> next = p ->node ;

P -> nextnode = next ;

d)

Newnode -> data = x ;

Newnode -> next = p ->next ;

P -> next = newnode ;

19.

D.S . stands for

a)

Digital Society

b)

Digital Standards

c)

Deputy Supreme

d)

Data structure

20.

This structure uses a pointer to link nodes.

a)

Variable

b)

Link List

c)

Pointer

d)

Trees