Data Structure and Algorithms (DSA)
10 of 14 sets
451. Select the set of instructions to insert a node pointed by q after a node pointed
by p
A. q->next=p->next; p->next=q;
B. p->next=q; q->next=p->next
C. both (a)and(b)
D. none of these
Answer:A
452. select the set of operations to insert a node pointed by q at the beginning of the
linked list
o m
A. q->next=head; head=q;
. c
B. head=q;q ->next=head;
te
C. both (a)and(b)
a
D. none of these
q M
Answer:A
c
M to delete the first node from a linked list
453. Select the set of operations
A. p=head;head=head->next;free(p);
B. free(head)
C. head=head->next;p=head;free(p)
D. none of these
Answer:A
454. Select the correct looping condition for positioning apointer p on the second
last in a linked list.Assume p=head,initially.
A. p->next->next!=null
B. p->next=null
C. p!=null
D. none of these
Answer:A
455. If address of the 8th element in a linked list of integers is1022,then address of
the 9th element is
A. 1024
B. 1026
C. 1023
D. unknown
Answer:D
456. The advantages of linked list over an array for representing a list is________
A. space used is less
B. deletion is easier
C. insertion is easier
D. both (a) and (b)
Answer:D
457. The address returned by malloc()is type casted because
A. malloc returns integers pointer
B. malloc returns void pointer
C. malloc returns an integer value
D. none of these
Answer:B
458. Which function returns a void pointers?
A. malloc returns integers pointer
B. calloc
C. both (a)and(b)
D. none of these
Answer:C
459. Select the correct statement
A. free is used to release memory allocated by malloc
B. free is used to release memory allocated by calloc
C. both (a)and(b)
D. only(a)but not(b)
Answer:C
View all MCQ's at McqMate.com
460. The____linked list can be processed in either direction.
A. singly
B. singly circular
C. doublyly
D. none of these
Answer:C
461. A polynominal in single variable should be handled using__
A. an array of structure
B. singly linked list
C. gll
D. both (a) and (b)
Answer:D
462. A node of doubly linked contains
A. pointer to predecessor
B. pointer to sucessor
C. both (a)and(b)
D. only(a)
Answer:C
463. Each node in a linear list contains an item called____which points to the next
node in the list.
A. node
B. link
C. variable
D. null
Answer:B
464. Which is not dynamic memory allocation function?
A. malloc returns integers pointer
B. calloc
C. alloc
D. free
Answer:C
View all MCQ's at McqMate.com
465. The function that allocates requested size of bytes and returns a pointer to the
first byte of the allocated space is
A. realloc
B. malloc
C. free
D. none of these
Answer:B
466. NULL link is not present in…
A. singly linked list
B. doubly linked list
C. circular linked list
D. none of these
Answer:C
467. 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.
Answer:B
468. A linear collection of data elements where the linear node is given by means of
pointer is called?
A. linked list
B. node list
C. primitive list
D. none
Answer:A
469. Which of the following operations is performed more efficiently by doubly
linked list than by singly linked list?
A. deleting a node whose location in 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
View all MCQ's at McqMate.com
Answer:A
470. Consider an implementation of unsorted singly linked list. Suppose it has its
representation with a head and tail pointer. Given the representation, which of the
following operation can be implemented in O(1) time?
i) Insertion at the front of the linked list
ii) Insertion at the end of the linked list
iii) Deletion of the front node of the linked list
iv) Deletion of the last node of the linked lis
A. i and ii
B. i and iii
C. i,ii and iii
D. i,ii and iv
Answer:C
471. Consider an implementation of unsorted singly linked list. Suppose it has its
representation with a head pointer only. Given the representation, which of the
following operation can be implemented in O(1) time?
i) Insertion at the front of the linked list
ii) Insertion at the end of the linked list
iii) Deletion of the front node of the linked list
iv) Deletion of the last node of the linked list
A. i and ii
B. i and iii
C. i,ii and iii
D. i,ii and iv
Answer:B
472. Consider an implementation of unsorted doubly linked list. Suppose it has its
representation with a head pointer and tail pointer. Given the representation,
which of the following operation can be implemented in O(1) time?
i) Insertion at the front of the linked list
ii) Insertion at the end of the linked list
iii) Deletion of the front node of the linked list
iv) Deletion of the end node of the linked list
A. i and ii
B. i and iii
View all MCQ's at McqMate.com
C. i,ii and iii
D. i,ii,iii and iv
Answer:D
473. In linked list each node contain minimum of two fields. One field is data field
to store the data second field is?
A. pointer to character
B. pointer to integer
C. pointer to node
D. node
Answer:C
474. What would be the asymptotic time complexity to add a node at the end of
singly linked list, if the pointer is initially pointing to the head of the list?
A. o(1)
B. o(n)
C. ? (n)
D. ? (1)
Answer:C
475. What would be the asymptotic time complexity to add an element in the linked
list?
A. o(1)
B. o(n)
C. o(n2)
D. none
Answer:B
View all MCQ's at McqMate.com