QUIZ QUESTION OF "DATA STRUCTURE USING C"

================================================

Unit 01 - 1 Mark Quiz Questions

================================================

Question 1

What is the value of a[3]? int a[]={5,4,3,2,1}

a. 2 The array index starts from 0 , so a[3] means 4th element

b. 3

c. 4

d. 1

================================================

Question 2

What is the size of the array? float a[10]

a. 10

b. 20

c. 30

d. 40 The array has 10 elements and each element occupies 4 bytes

================================================

Question 3

A structure brings together a group of

a. items of the same data type

b. related data items and variables The structure is the collection of data items

c. integers with user defined names

d. floating points with user defined names

================================================

Question 4

IF an integer occupies 4 bytes and character occupies 1 byte of memory , each element of following structure would occupy how many byte?

struct name

{

int age;

char name[30];

};

a. 30

b. 34

c.28

c40

1. a

2. b The total size of the structure is the sum of the size of all elements ( 4 Bytes *1 integer type) and ( 30 *1 Character type) = 34

3. c

4. d

================================================

Question 5

Pointer holds :

a. Value of variable

b. Address of variable Pointer always holds the address

c. Value and address of variable

d. Always null

================================================

Question 6

A pointer can hold

a. Two addresses at a time

b. Single address at a time Pointer always can hold one address at a time

c. Number of addresses at a time

d. No address

================================================

Unit 01 - 2 Mark Quiz Questions

================================================

Question 1

Array index can be started from 1?

a. Yes

b. No The array always started from 0 , no alteration is possible

================================================

Question 2

Array is :

a. Primary data type

b. Homogeneous data type Each array contains same types of data so homogeneous

c. Pointer data type

d. Heterogeneous data type

================================================

Question 3

To accept 100 different values into the array we require:

a. Loop To carry out same task repeatedly we use Loops

b. If condition

c. Function

d. Structure

================================================

Question 4

To identify a member element of a structure we use :

a. dot (.) operator . is the membership operator of any structure variable

b. plus(+) operator

c. * operator

d. & operator

================================================

Question 5

We can create array of structure:

a. Yes Number structure may form an array

b. No

================================================

Unit 01 - 4 Mark Quiz Questions

================================================

Which of the following is the correct way of declaring an array of integer pointers?

a. int *arr[10]; The array pointer means the subscripted pointer variable can hold numbers of same types of variable addresses

b. int arr[10];

c. *int arr[10];

d. int *arr;

================================================

Unit 02

================================================

The data structure has the following components

Choose one answer. a. Algorithm, storage structure and function of implementation Three element that form a data structure are: Algorithm, Storage Structure , Function

b. Algorithm, data type and function of implementation

c. Function, storage structure and program

d. Algorithm, data structure and program

================================================

Question 2

In linked list, the successive element

a. Must occupy contiguous locations in memory

b. Need not occupy contiguous space in memory Link list always occupies random memory allocation

c. Must not occupy contiguous locations in any situation

d. None of the above

================================================

Question 3

Link pointer variable in linked list contain address of the

a. Following node in the list Link list connect together with address

b. Current node in the list

c. First node in the list

d. None of the above

================================================

Question 4

Which of the following liner list structure allow both insertion and deletion at only one end?

a. Queue

b. Stack Stack is onside open to insert and delete like a bottle

c. Circular queue

d. None of the above

================================================

Pick out invalid statement from following : Queues can be used for

a. The line printer Queue is like a pipe with one entrance for ENTRY and other end for EXIT

b. Access to disk storage

c. Function call

d. Main Memory Access

================================================

UNIT=3

================================================

Question 1

When PUSH operation is done then

a. TOP=TOP+1 The pointer TOP is incremented by one , Initially TOP

b. -1

c. TOP= TOP-1

d. TOP=-1

e. TOP=0

================================================

Question 2

When POP operation is done then

a. TOP=TOP+1

b. TOP= TOP-1 The pointer TOP is decremented by

c. TOP=-1

d. TOP=0

================================================

Question 3

In Stack we insert data from:

a. Front End

b. Rear End

c. Both End

d. Top End Stack has only one end called Top End, No Front ,No Rear

================================================

Question 4

The Stack overflow occurs when

a. When stack contains maximum elements The stack when unable to add more elements

b. When stack contains minimum elements

c. When stack contains half of the maximum elements

d. When stack is empty

================================================

Question 5

If the in-order pre-order traversal of a binary tree are D,B,F,E,G,H,A,C and A,B,D,E,F,G,H,C respectively then post order will be:

a. D,F,G,A,B,C,H,E

b. F,H,D,G,E,B,C,A

c. D,F,H,G,E,B,C,A For Post order the algorithm is LEFT

d. C,G,H,F,E,D,B,A

================================================

Question 6

Stack is useful for implementing breadth first search

a. True

b. False We cannot use stack for breath first search

================================================

Question 1

We can change the insertion position of the Stack

a. Yes

b. No The stack cannot be reversed

================================================

Question 2

In the Sack STACK_SIZE is :

a. Fixed The size of the stack is fixed at the time of creation, it cannot be changed at runtime

b. Variable

================================================

Question 3

Stack maintains the algorithm

a. LIFO

b. FIFO

c. FILO

d. LILO

================================================

Question 4

The stack is easy to maintain by

a. Array No insertion and deletion is made in between the stack, only from one end-Array is easy

b. Link List

c. Structure

d. Union

================================================

Question 5

The Polish Notation is

. a. Post order

b. Pre order The pre order is called polish Notation.

c. In order

d. None of these

================================================

Question 6

Infix to post fix conversion we need :

a. Stack A stack is required to hold the operators

b. Queue

c. Structure

d. Union

================================================

A stack cannot be used to

a. evaluate an arithmetic expression in postfix form

b. implement recursion

c. convert infix form to postfix from of an expression

d. allocate resources by operating system For random memory allocation we cannot use stack

================================================

Question 2

Application of Stack is :

a. Function Call For function call stack operation is needed

b. Storage data in memory

c. Dynamic memory allocation

d. Structure definition

================================================

Question 3

Requirement of Polish Notation

a. Because the notation does not have any priority The notation does not have any priority so it is used in expression evaluation

b. Because the notation have priority

================================================

UNIT=4

================================================

Question 1

Josephus Problem is the application of

a. Ordinary Queue

b. Circular Queue The continuous rotation is done in that problem so it needs Circular Queue

c. Double Ended Queue

d. Priority Queue

================================================

Question 2

The priority queue requires FRONT and REAR:

a. One only

b. Multiple To maintain different priority , Queue required number of FRONT and REAR pointers

c. None

d. Two only

================================================

Question 3

Which of the following data structure may give overflow error, even though the current number of elements in it is less than its size?

a. stack

b. circular queue

c. simple queue The queue has two pointer front and rear for insert and delete elements

d. none of the above

================================================

Question 4

The basic problem of space utilization has been removed by

a. Stack

b. Circular Queue The circular queue circulate the pointer so it utilise the queue spaces

c. Double Ended Queue

d. Queue Size

================================================

Question 5

What algorithm is used in Queue?

a. FILO

b. LILO

c. FIFO The queue has Front and Rear end for Delete and Insert elements

d. LIFO

================================================

Question 6

From which end of Queue elements are deleted?

a. Rear

b. Front The delete elements from Front end only.

c. Middle Position

d. Any position of the queue

================================================

Question 1

The access of Queue elements is

a. Sequential The elements of the Queue is one after another , so its access is sequential

b. Random

c. Direct

d. Indexed

================================================

Question 2

Front and Rear can be interchangeable in

a. Dqueue The double ended queue can change its position front by rear and vice versa

b. Priority Queue

c. Circular Queue

d. Ordinary Queue

================================================

Question 3

What is the difference between Stack & Queue?

a. Storage Structure

b. Memory Allocation

c. Algorithm The main algorithm differs between Stack and Queue

d. All of the Above

================================================

Question 4

Queue can be represented by

a. Array

b. Link List

c. Tree

d. Only a) and b) We can represent Queue by array and link list also

================================================

Question 5

The Queue Size can be:

a. Dynamically changed

b. Static, cannot he changed The size of the queue is fixed when created

================================================

Question 6

POP from queue needs checking

a. Queue Full Condition

b. Queue Empty Condition Before POP operation it must be checked that item is available or not

c. Stack Full Condition

d. Stack Empty Condition

================================================

Question 1

One Application of Priority Queue is

a. CPU scheduling CPU scheduling sometimes uses priority based scheduling

b. Ready Queue for printing

c. Data Access from RAM

d. Reading data through Scanner

================================================

Question 2

Queue is :

a. Linear Data Structure Queue is continuous sequential so it is linear data structure

b. Non Linear Data Structure

================================================

Question 3

Queue is easy to implement by

a. Array Queue operation cannot use random access of elements so it is easy by array

b. Link List

c. Structure

d. Union

================================================

UNIT=5

================================================

Question 1

In Circular Link List

a. Head node contains the address of tail node

b. Tail node contains the address of the head To make the list circular, tail node contains the address of head

c. Head node contains the address of the middle node

d. Tail node contains the address of the middle node

================================================

Question 2

In Doubly Linked List each node contains

a. No address part

b. One address part

c. Two address part The double linked list node holds the address of previous and next node, so two address part

d. Three address part

================================================

Question 3

Linked List is

a. Linear Data Structure The linked list contains sequential of nodes so it is linear structure

b. Non Linear Data Structure

================================================

Question 4

To create linked list created by

a. Structure By using structure we can connect one node to another

b. Union

c. Array

d. Macro

================================================

Question 1

We can traverse in either direction

a. Singular Linked List

b. Circular Linked List

c. Doubly Linked List The doubly linked list node holds address of previous and next node address.

d. Tree Linked List

================================================

Question 2

The application of Linked List

a. Add two characters

b. Add two large numbers To add two large numbers we use linked list

c. Add two Strings

d. Add two very small numbers

================================================

Question 3

Each node of linked list has two parts

a. Data & Address The linked list has two parts data and address to hold the other node

b. Data & Null

c. Address & Null

d. Address & Address

================================================

Question 4

Linked List allocate memory space in

a. Direct fashion

b. Contiguous fashion

c. Random fashion The linked list allocates memory space in random order

d. Indexed fashion

================================================

Can we delete the head node from Doubly Linked List

a. True The second node will be the head node

b. False

================================================

Question 2

Advantage of Linked List over array

a. Linked List occupies less memory

b. Linked List can be stored in disk

c. Deletion of nodes is easy than array The deletion of node is easy over array, array does not have direct deletion option

d. Linked List is easy to maintain

================================================

UNIT=6

================================================

Question 1

Number of all possible binary trees with 2 nodes is

a. 1

b. 2 By changing the passion we get only two possible ways

c. 3

d. 4

================================================

Question 2

Binary tree and Binary Search Tree are same

a. True

b. False Correct, the additional feature of binary search tree is order

================================================

Question 3

Which of the following statements is TRUE? A B-Tree of order

a. 24 contains at least 12 key in each non root node.

b. 25 contains at least 12 keys in each node

c. 24 contains at least 23 keys in each non root node One node contains one less than the order of that tree. So it is24

d. None of the above.

================================================

Question 4

What is the minimum number of keys contained in each non root node of a B-Tree of order 11?

a. 4

b. 5 The value will be 5 because when the node splits from median then it contains half of the nodes in the either side of the nodes.

c. 3

d. 1

================================================

Question 1

Binary Tree Traversal is faster in

a. Ordinary Binary Tree

b. Binary Search Tree

c. Threaded Binary Tree Threaded binary tree will traverse faster due to its thread to go back to parent

d. AVL Tree

================================================

Question 2

Full Binary Tree and Complete Binary Tree are same

a. True

b. False These two trees are not same. Full binary tree must have each node with two or none children but complete binary tree must have all leave nodes in same order

================================================

Question 3

If the degree of a node if 0 then the tree is called

a. Trinary Tree

b. Single Edged tree

c. Single node tree Single node tree does not have any edge so it is possible

d. Single degree tree

================================================

Question 4

To traverse from one node to another in the tree

a. There may be many path

b. There may be only one path Tree will be one and only one path

================================================

Question 1

AVL tree is a special types of

a. Binary Tree

b. Binary Search Tree AVL Tree is a binary search tree with special property

c. Threaded Binary Tree

d. B-Tree

================================================

Question 2

In AVL Tree, the Balance Factor is calculated as

a. Left Height-Left Height

b. Right Height-Right Height

c. Left Height-Right Height

d. Middle Height-Right Height

================================================

Question 3

The minimum balance factor of a node in AVL tree is

a. -2

b. -1 The minimum balance factor is -1, it is correct

c. 0

d. 1

================================================

Question 4

The Polish Notation is

a. Prefix notation Prefix is the polish notation

b. Postfix notation

c. Infix notation

d. All of the above

================================================

Question 5

Like Graph Tree can be directed or undirected

a. True

b. False Correct! No direction is possible in case of Tree

================================================

Question 6

In complete binary tree the number of nodes in level 0 is

a. 0

b. 1 The formula to obtain the number of nodes is 2n

c. 2

d. 3

================================================

Question 7

In the tree which node has not child called

a. Root node

b. Leaf node Leaf node does not have child

c. Parent node

d. Internal node

================================================

UNIT=7

================================================

Question 1

For Graph Traversal

a. DFS & BFS Correct! These are the graph traversal

b. prefix

c. Infix

d. Postfix

================================================

Question 2

Spanning Tree related to

a. Kruskal's Algorithm Correct! It is the right answer

b. Piterson's Algorithm

c. Newton's Algorithm

d. Ratherford's Algorithm

================================================

Question 3

An adjacency matrix representation of a graph cannot contain information of

a. Nodes Correct! information of node is not stored but edges information are stored

b. Edges

c. direction of edges

d. parallel edges

================================================

Question 4

The strongly connected graph

a. can connect from one node to any other node Correct! Can connect one to other

b. can connect from few nodes to other few nodes

c. cannot connect to other nodes

d. can connect only one node

================================================

Question 1

To find the shortest path between two nodes which algorithm is used?

a. Kruskal's Algorighm

b. Prim's Algorithm

c. Dijkstra's algorithm Correct! Your understanding is good

d. All of the above

================================================

Question 2

For graph traversal BFS algorithm, we required

a. STACK

b. QUEUE

c. ARRAY

d. STRUCTURE

================================================

Question 3

If no parallel edges in a 4 vertices graph , what is the maximum degree of a vertex?

a. 4

b. 3 Every connect to other directly is the maximum degree which is 4-1 = 3

c. 2

d. 1

================================================

Question 4

How many elements will be in the matrix , if there are 5 elements in a graph ?

a. 5

b. 25 Correct! It is exactly 25, the square of 5

c. 55

d. 15

================================================

Warshall's Algorithm is used for

a. Shortest path Correct, your selection

b. Sort path

c. Long path

d. Maximum path

================================================

Question 2

DFS & BFS are same

a. True

b. False Correct! The algorithm are different

================================================

Question 3

In Kurskal's algorithm

a. Shortest select first Correct! Shortest select first

b. Largest select first

================================================

Question 4

In Kruskal's Algorithm

a. Checks Looping Yes! It checks the looping if loop occurs it rejects the edge

b. Checks no looping

================================================

Question 5

In prim's algorithm

a. Checks neighbour edges True! It checks neighbour edges with small weight

b. Checks small edges only

================================================

Question 6

In Dijkstra's algorithm a means

a. Connected

b. Not connected Correct! Yes not directly connected implies that symbol

================================================

Question 7

In Kruskal's and Prim's algorithm the shortest path value will

a. Always Same Correct! Always same

b. Always different

c. Sometimes same

d. Sometimes different

================================================

UNIT=8

================================================

Question 1

What is the average number of comparisons in linear search

a. (n+1)/2 Correct! it is the correct one

b. (2n+1)/2

c. (n+1)

d. 2(n+1)

================================================

Question 2

Linear search is not possible over sorted list

a. Yes Yes! It is possible over sorted and unsorted list

b. No

================================================

Question 1

In binary search

a. Elements may be in arrange order

b. Elements must be in arrange order

c. Elements must not be in arrange order

d. All of the above

================================================

Question 2

What is the maximum number of comparisons in binary search

a. [Iog2n] + 1

b. [log10n]+1

c. [log2n]+2

d. [log10n]+2

================================================

Question 1

For searching a pages from your book , which method is generally used

a. Linear Search

b. Binary Search

================================================

UNIT=9

================================================

Question 1

Sorting means

a. Order in first com first serve

b. Order in ascending or descending of values

================================================

Question 2

The time complexity of Bubble Sort is

a. O

b. O(n2)

c. O(n long n)

d. O(log n)

================================================

Question 1

Which one is stable sort?

a. Bubble Sort

b. Selection Sort

c. Insertion Sort Correct! Insertion sort is a stable sort because it does not change the relative order of elements with equal keys

d. Quick Sort

================================================

Question 2

For Heap Sort

a. First create heap then

b. First sort then create heap

c. Need not to create heap

d. Just create heap and no required to sort further

================================================

Question 2

Divide and conquer strategy follows in

. a. Quick sort

b. Heap sort

c. Bubble sort

d. Marge sort

================================================

Question 3

Marge sort continues its division until n elements in the list. The value of n is:

a. 0

b. 1 Correct you are right

c. 2

d. 3

================================================

Question 4

In case of external sorting algorithm

a. Need to check secondary disk access type

b. Need to check primary memory access type

c. None of the above

d. a) and b) both should be checked

================================================

Question 6

Internal sorting mainly done in

a. Main Memory Correct ! it is done in main memory

b. Secondary Memory

===============================================

*the end*

===============================================

**Like the Post? Share with your Friends:-**