Menu

Lists Questions

MCQ
101.
What would be the asymptotic time complexity to find an element in the linked list?
forum Discussion
MCQ
102.
What would be the asymptotic time complexity to insert an element at the second position in the linked list?
forum Discussion
MCQ
103.
The concatenation of two list can performed in O(1) time. Which of the following variation of linked list can be used?
forum Discussion
MCQ
104.
Consider the following definition in c programming language.
struct node
{
int data;
struct node * next;
}
typedef struct node NODE;
NODE *ptr;
Which of the following c code is used to create new node?
forum Discussion
MCQ
105.
Linked lists are not suitable to for the implementation of?
forum Discussion
MCQ
106.
Linked list is considered as an example of ___________ type of memory allocation.
forum Discussion
MCQ
107.
In Linked List implementation, a node carries information regarding
forum Discussion
MCQ
108.
Linked list data structure offers considerable saving in
forum Discussion
MCQ
109.
What does the following function do for a given Linked List with first node as head?
forum Discussion
MCQ
110.
The following function reverse() is supposed to reverse a singly linked list. There is one line missing at the end of the function.

/* Link list node */
struct node
{
    int data;
    struct node* next;
};
 
/* head_ref is a double pointer which points to head (or start) pointer 
  of linked list */
static void reverse(struct node** head_ref)
{
    struct node* prev   = NULL;
    struct node* current = *head_ref;
    struct node* next;
    while (current != NULL)
    {
        next  = current->next;  
        current->next = prev;   
        prev = current;
        current = next;
    }
    /*ADD A STATEMENT HERE*/
}

What should be added in place of "/*ADD A STATEMENT HERE*/", so that the function correctly reverses a linked list.
forum Discussion