Data Structure


Q191.

Consider a singly linked list of the form where F is a pointer to the first element in the linked list and L is the pointer to the last element in the list. The time of which of the following operations depends on the length of the list?
GateOverflow

Q192.

N items are stored in a sorted doubly linked list. For a delete operation, a pointer is provided to the record to be deleted. For a decrease-key operation, a pointer is provided to the record on which the operation is to be performed. An algorithm performs the following operations on the list in this order: \Theta(N) \; delete , O(logN) \; insert , O(logN) \; find , and \Theta(N) \; decrease-key. What is the time complexity of all these operations put together?
GateOverflow

Q193.

In a doubly linked list the number of pointers affected for an insertion operation will be
GateOverflow

Q194.

The minimum number of fields with each node of doubly linked list is
GateOverflow

Q195.

Which of the following operations is performed more efficiently by doubly linked list than by linear linked list?
GateOverflow

Q196.

Given two statementsInsertion of an element should be done at the last node of the circular listDeletion of an element should be done at the last node of the circular list
GateOverflow

Q197.

The following C function takes a simply-linked list as input argument. It modifies the list by moving the last element to the front of the list and returns the modified list. Some part of the code is left blank. typedef struct node { int value; struct node *next; } Node; Node *move_to_front(Node *head) { Node *p, *q; if ((head = = NULL: || (head->next = = NULL)) return head; q = NULL; p = head; while (p-> next !=NULL) { q=P; p=p->next; } _______________________________ return head; } Choose the correct alternative to replace the blank line.
GateOverflow

Q198.

An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum is
GateOverflow

Q199.

The following steps in a linked list p = getnode() info(p) = 10 next (p) = list list = p result in which type of operation?
GateOverflow

Q200.

Consider a single linked list where F and L are pointers to the first and last elements respectively of the linked list. The time for performing which of the given operations depends on the length of the linked list?
GateOverflow