You are on page 1of 10

MULTILE CHOICE QUESTIONS

1. Which of the following statement is false?


(a) Arrays are dense lists and static data structure
(b) Data elements in linked list need not be stored in adjacent space in memory
(c) Pointers store the next data element of a list
(d) Linked lists are collection of the nodes that contain information part and next pointer
2. Linked lists are suitable for which of the following problems? 
(a) Insertion sort (b) Binary search
(c) Selection Sort (d) Polynomial manipulation
3. The statement head->Link->Link->Link = NULL terminates a linked list after its node.
(a) 2nd                     (b) 4th     
(c)  5th                     (d) 3rd                    
4. Consider the following two statements and choose the correct option:
I. According to Access strategies, Linked List is a linear one.
II. According to Storage, Linked List is a Non-linear one.
(a) (I) is true but (II) is false (b) (I) is false but (II) is true
(c) Both (I) and (II) are true (d) Both (I) and (II) are false
5. What kind of list is best to answer questions such as "What is the item at position n?"
(a) Lists implemented with an array.
(b) Doubly-linked lists.
(c) Singly-linked lists.
(d) Doubly-linked or singly-linked lists are equally best
6. Which of the following statement is false?
(a) Arrays are dense lists and static data structure 
(b) Data elements in linked list need not be stored in adjacent space in memory
(c) Pointers store the next data element of a list
(d) Linked lists are collection of the nodes that contain information part and next pointer
7. is not an operation performed on linear list.
(i) Insertion         (ii) Deletion        
(iii) Retrieval         (iv) Traversal
(a) Only (i), (ii) and (iii) (b) Only (i) and (ii)
(c) All (d) None
8. Which of the following statement is true?
(i) Using singly linked lists, it is not possible to traverse the list backwards.
(ii) To find the predecessor, it is required to traverse the list from the first node in case of singly
linked list.
(a) (i) only (b) (ii) only
(c) Both (i) and (ii) (d) None
9. Consider a linked list of n elements. What is the time taken to insert an element after an element
pointed by some pointer?
(a) O(1) (b) O(log2 n)
(c) O(n) (d) O(n log2 n)
10. In a circular linked list
(a) components are all linked together in some sequential manner.
(b) there is no beginning and no end.
(c) components are arranged hierarchically.
(d) forward and backward traversal within the list is permitted.
11. Which of the following operations is performed more efficiently by doubly linked list than by
singly linked list?
(a) Deleting a node whose location is given
(b) Searching of an unsorted list for a given item
(c) Inverting a node after the node with given location
(d) Traversing a list to process each node
12. Lists may be either array-based or pointer-based (linked lists). Which of the following specify an
advantage of a pointer-based implementation of a list over an array-based implementation of
a list:
(a) Less space for each item
(b) Faster inserts and removes in the middle of the list
(c) No unused space
(d) All the above
13. Deleting a node from a linked list normally involves
(a) changing the data value in the node
(b) changing the value of the node's next reference
(c) changing the link in another node so as not to point to the deleted node
(d) changing the link in another node to point to the deleted node
14. To access a certain node in a singly-linked list 
(a) takes one step
(b) takes two steps
(c) requires that all its predecessors be visited
(d) requires that all its successors be visited
15. To delete a node a singly linked list, using the best-known algorithm, the address of which node
must be known?
(a) none
(b) the first
(c) the predecessor of the node to delete
(d) the node to delete
16. Search of a linked list of n nodes may require visiting upto how many nodes?
(a) 1 (b) 2
(c) n (d) 0
17. In a linked list, the logical order of elements 
(a) is same as physical order
(b) is not necessarily same as physical order
(c) is determined by physical arrangement
(d) none of the above
18. NULL is used to 
(a) store Null value in pointer field
(b) store −1 in any variable
(c) store Null value in data field
(d) none of the above
19. Which linked list does not have NULL link?
(a) Singly linked list (b) Doubly linked list
(c) Circular linked list (d) all the above
20. A dummy header is 
(a) a head node at the start of the linked list storing first element
(b) a head node at the start of the linked list storing no value
(c) a head node anywhere in the list
(d) none of the above
21. The variable declaration NODE *ptr will require memory size 
(a) 4 bytes (b) 2 bytes
(c) 6 bytes (d) can’t determine
22. The variable declaration struct node n1 will require memory size 
(a) 4 bytes (b) 2 bytes
(c) 6 bytes (d) 1 byte
23. What will be output of following code?
ptr1=(NODE*) malloc (size of (NODE));
ptr2=(NODE*) malloc (size of (NODE));
ptr1data=10;
ptr2data=20; ptr2next=ptr1;
printf(“%d”, (ptr2next)data);
(a) 10 (b) 20
(c) NULL (d) 0
24. Moving all allocated blocks to one end of memory is called 
(a) compaction (b) garbage collection
(c) first fit (d) buddy system
25.  will arise if you try to delete data from a list which is empty.
(a) overflow (b) underflow
(c) garbage collection (d) compaction
26. Collecting all deleted memory blocks onto free storage list is called 
(a) compaction (b) garbage collection
(c) first fit (d) best fit
27. The list which is maintained for storing unused memory blocks is called 
(a) singly linked list (b) unused list
(c) free storage list (d) garbage list
28. The situation where no space is available into a data structure when a new item is to be inserted
is called 
(a) overflow (b) underflow
(c) compaction (d) no fit
29. When memory block of required size is not available, malloc function returns 
(a) NULL (b) address of any memory block
(c) error (d) inf
30. How many links are created when a new item is inserted into a singly linked list somewhere
inbetween the two nodes?
(a) 0 (b) 4
(c) 1 (d) 2
31. How many links are created when a new item is inserted into DLL somewhere in between two
nodes.
(a) 2 (b) 4
(c) 6 (d) 3
32. How many links are removed when a new item is inserted into a SLL somewhere in between two
nodes?
(a) 0 (b) 1
(c) 2 (d) 3
33. To store a polynomial in a SLL you require a mode with  fields.
(a) 2 (b) 3
(d) 4 (d) 1
34. If we have circular list with only one element and ptr is a pointer to that node then the
statement ptrnextnextdata will display
(a) element stored in list (b) garbage
(c) NULL (d) address of list
35. Which of the following is disadvantage of DLL?
(a) Traversal is less efficient
(b) Traversal is slower
(c) Move space requirement
(d) Cannot insert element
36. To delete first element in SLL the address stored in the pointer to first node should be 
(a) equal to address of second node
(b) value of second node
(c) address of last node
(d) none of the above
37. Given a pointer to a node we can traverse in backward direction in 
(a) doubly linked list (b) circular linked list
(c) both (a) and (b) (d) none of the above
38. Suppose ptr points to a node in a linked list. What statement will change ptr to point to next
node where the link field is defined as next?
(a) ptr + f (b) ptr = ptr + 1
(c) ptr = ptr  next (d) all the above
39. Suppose ptr points to last node in the linked list. Which of the following statements will be true?
(a) ptrnext!=NULL (b) ptr!=NULL
(c) ptrnext==NULL (d) ptr==NULL
40. If a self-referential structure is defined as 
typedef struct node
{
char name[20];
struct node *next;
} NODE;
then what is size of (NODE)
(a) 4 bytes (b) 20 bytes
(c) 22 bytes (d) 3 bytes
41. The linked list can be implemented using array 
(a) True (b) False
42. Malloc function returns 
(a) address of the requested amount of memory block
(b) always NULL
(c) size of memory block
(d) none of the above
43. The node size of each node in doubly linked list of characters will be 
(a) 4 bytes (b) 6 bytes
(c) 5 bytes (d) 3 bytes
44. In a circularly linked list organisation, insertion of a record involves the modification of 
(a) no pointer (b) 1 pointer
(c) 2 pointers (d) 3 pointers
45. The concatenation of two lists is to be performed in O(1) time. Which of the following
implementations of a list could be used?
(a) Singly linked list (b) Doubly linked list
(c) Circular doubly linked list (d) All the above
Answer The following questions (46-48) based on the code given below
typedef struct node
{
int data;
struct node *next, *prev;
}NODE;
NODE *ptr, *temp;
Ptr=(NODE *)malloc(sizeof(NODE));
Ptr->data=10; ptr->next=ptr; ptr->prev=ptr;
Printf(“%d”, ptr->next->prev->data);
temp=prt->next;
Printf(“%d”, temp->next->prev->data);

46. The above code creates


(a) Singly linked list (b) Simple Doubly linked list
(c) Circular doubly linked list (d) None of the above
47. The output of first printf statement will be
(a) 10 (b) Can’t be determined
(c) Garbage (d) 0
48. The output of second printf statement will be
(a) 10 (b) Can’t be determined
(c) Garbage (d) 0

Answer The following questions(49-51) based on the code given below


typedef struct node
{
int data;
struct node *next;
}NODE;
NODE *ptr, *temp;
Ptr=(NODE *)malloc(sizeof(NODE));
Ptr->data=10; ptr->next=ptr;
Printf(“%d”, ptr->next->next->data);
temp=prt->next;
Printf(“%d”, temp->next->next->data);

49. The above code creates


(a) Doubly Linked list (b) Simple Singly linked list
(c) Circular Singly linked list (d) None of the above
50. The output of first printf statement will be
(a) 10 (b) Can’t be determined
(c) Garbage (d) 0
51. The output of second printf statement will be
(a) 10 (b) Can’t be determined
(c) Garbage (d) 0
Answer The following questions(52-54) based on the code given below
typedef struct node
{
int data;
int next;
}NODE;
NODE list[3];
for(i=0;i<3;i++)
list[i].data=10*i;
first=2;
list[0].next=-1;
list[1].next=0
list[2].next=1;
temp=first;
while(temp!=-1)
{
printf(“%d ”,list[temp].data)
temp=list[temp].next;
}
52. The output of the code will be
(a) 0 10 20 (b) 20 10 0
(c) 0 20 10 (d) 0
53. The above code generates Circular linked list
(a) True (b) False
54. The above code generates Singly linked list
(a) True (b) False
55.  header list combines advantages of a two-way list and circular header list
(a) One Way (b) Two way
(c) Two-way Circular (d) Header
56. A polynomial can be stored using 
(a) Array (b) Linked List
(c) Both (a) and (b) (d) Stack
57. The  can be traversed in both forward and backward direction
(a) Singly linked list (b) Doubly linked list
(c) Circular linked list (d) All the above

58.  is a linked list which always contains a special node at beginning of the list
(a) Singly linked list (b) Doubly linked list
(c) Header linked list (d) All the above
Answer The following questions(59-60) based on the code given below
typedef struct node
{
int data;
struct node *next;
}NODE;
NODE *ptr, *temp=NULL; int i;
for(i=1;i<=4;i++)
{
ptr=(NODE *)malloc(sizeof(NODE));
ptr->data=i*10;
ptr->next=temp
temp=ptr;
}
while(temp!=NULL)
{
printf(“%d “,temp->data);
temp=temp->next;
}

59. The above program creates & displays


(a) Singly liked list (b) Doubly linked list
(c) Circular linked list (d) None of the above
60. The output of above code will be
(a) 10 20 30 40 (b) 40 30 20 10
(c) 1 2 3 4 (d) Garbage

Answer The following questions (61-62) based on the code given below
typedef struct node
{
int data;
struct node *next;
}NODE;
NODE *ptr, *temp=NULL; int i;
for(i=1;i<=4;i++)
{
ptr=(NODE *)malloc(sizeof(NODE));
ptr->data=i*10;
ptr->next=temp
temp=ptr;
}
while(temp!=NULL)
{
printf(“%d “,temp->data);
temp=temp->next->next;
}

61. The above program creates


(a) Singly liked list (b) Doubly linked list
(c) Circular linked list (d) None of the above
62. The output of above code will be
(a) 10 20 (b) 40 20
(c) 1 2 (d) Garbage
Answer The following questions(63-65) based on the code given below
int DATA[3], NEXT[3];
for(i=0;i<3;i++)
DATA[i]=10*i;
first=2;
NEXT[0]=-1;
NEXT[1]=0
NEXT[2]=1;
temp=first;
while(temp!=-1)
{
printf(“%d ”,DATA[temp])
temp=NEXT[temp];
}

63. The output of the code will be


(a) 0 10 20 (b) 20 10 0
(c) 0 20 10 (d) 0
64. The above code generates Circular linked list
(a) True (b) False
65. The above code generates Singly linked list
(a) True (b) False

1. (c) 2. (d) 3. (d) 4. (d) 5. (a) 6. (c) 7. (c) 8. (c) 9. (a) 10. (b)
11. (a) 12. (d) 13. (c) 14. (c) 15. (c) 16. (c) 17. (b) 18. (a) 19. (c) 20. (b)
21. (b) 22. (a) 23. (a) 24. (a) 25. (b) 26. (b) 27. (c) 28. (a) 29. (a) 30. (d)
31. (b) 32. (a) 33. (b) 34. (a) 35. (c) 36. (a) 37. (a) 38. (c) 39. (c) 40. (c)
41. (a) 42. (a) 43. (c) 44. (c) 45. (d) 46. (c) 47. (a) 48. (a) 49. (c) 50. (a)
51. (a) 52. (b) 53. (b) 54. (a) 55. (c) 56. (c) 57. (b) 58. (c) 59. (a) 60. (b)
61. (a) 62. (b) 63. (b) 64. (b) 65. (a)

You might also like