Professional Documents
Culture Documents
I. MULTIPLE CHOICE. Choose the letter of the correct answer by writing the letter on the blank
provided before each number.
___D__ 1. Types of data structures are …
___B__ 2. In this type of data structures, data structures, data values of different types are grouped,
as in structures and classes. Refer to …
a. Homogenous
b. Non-homogenous
__B___ 3. A container which can hold a fix number of items and these items should be of the same
type. Most of the data structures make use of arrays to implement their algorithms.
a. Element
b. Array
c. Index
a. Queue
b. Stack
c. Arrays
d. All of the above.
___C_ 5. An algorithm is
a. Creation
b. Sorting
c. Selection
d. All above.
a. Traversal
b. Merging
c. Inserting
d. Sorting
__A___ 9. Which of the following data structure can’t store the non-homogenous data elements?
a. Arrays
b. Records
c. Pointers
d. None of the above.
__A___ 10. Type data abstraction which allows conceptual representation of data in database
management system is considered as
a. Logical design model
b. Data Model
c. Interface Model
d. User friendly model
___C__ 11. For a binary search algorithm to work, it is necessary that array (list) must be
a. Unsorted
b. In a heap
c. Popped out of stack
__B___ 12. Which of the following searching techniques do not require the data to be in sorted form
a. Interpolation Search
b. Linear Search
c. Binary Search
d. All of the above
__B___ 13. What data structure is used for depth first traversal of a graph?
a. Queue
b. Stack
c. List
d. None of the above.
___B__ 14. If the array is already sorted, which of these algorithms will exhibit the best
performance? a. Merge sort
b. Insertion Sort
c. Quick Sort
d. Heap Sort
___B__ 16.In addition to the information and link components, the linked list must also contain what
other components?
____B_ 17.Given the fixed size of an array is not important, which class is more efficient at storing
and retrieving information?
a. A linked list because of the nodes
b. An array because of the reduced code and efficient storage allocation
c. Neither ir more efficient over the other
_B____ 18.What is the proper code for accessing the information of the second item in a linked list?
a. Head.info
b. Head.link.info
c. Head.linl.link.info
___B__ 23. In addition to the information and link components, the linked list must also contain
what other components?
a. Sorting information about the list
b. Head and tail pointers to the first and last nodes
c. The current node that was last accessed
__B___ 24. Given the fixed size of an array is not important, which class is more efficient at storing
and retrieving information?
__B___ 25. A stack is a data structure that implements movement of data in which format?
____B_ 28. A data structure that changes in size as a program needs it by allocating and
deallocating memory is about …What approaches are generally used for implementing a stack data
structure?
__A___ 30. Which one of the following is an application of Queue Data Structure?
main(){
int LA[]={1,3,5,7,8}; int
item =10, k =3, n =5;
int i =0, j = n;
OUTPUT:
The original array elements are :
LA[0] = 1
LA[1] = 3
LA[2] = 5
LA[3] = 7
LA[4] = 8
The array elements after insertion :
LA[0] = 1
LA[1] = 3
LA[2] = 5
LA[3] = 10
LA[4] = 7
LA[5] = 8
_B____ 1.
procedure EnQ(data)
if queue is full
return overflow
endif
rear ← rear +1
queue[rear]← data return
true
end procedure
__D___ 2.
begin procedure PuS: stack, data
if stack is full
returnnull
endif
top ← top +1
stack[top]← data
end procedure
___A_ 3.
#include<stdio.h>
LA[k-1]= item;
___H__ 5.
procedure dq
if queue is empty
return underflow
endif
data = queue[front]
front ← front +1
returntrue end
procedure
__C___ 6.
if(isEmpty())
{ last= link;
}else{
head->prev = link;
} link->next= head;
head =
link; }
___F__ 7.
if(isEmpty())
{ last= link;
}else{ last-
>next= link; }
last= link;
_J____ 8.
struct node* deleteFirst()
if(head->next== NULL)
{ last= NULL;
}else{
head->next->prev = NULL;
} head = head->next;
return
tempLink; }
__I___ 9.
#include<stdio.h>
while( j < n)
{ if( LA[j]== item
){ break; }
j = j
+1; }
if(!isempty())
{ data =
stack[top]; top =
top -1; return data;
}else{
printf("Could not retrieve data, Stack is empty.\n");
}
}