Skip to content

ISRO Scientist/Engineer CSE 2014Data Structures › Linked Lists

ISRO Scientist/Engineer CSE 2014 PYQ: Consider a single linked list where $F$ and $L$ are pointers to the first and last elements respectively of…

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?

  1. A
    Delete the first element of the list
  2. B
    Interchange the first two elements of the list
  3. C
    Delete the last element of the list
    Correct answer
  4. D
    Add an element at the end of the list

Answer

(C) Delete the last element of the list

Approach

We have a singly linked list with head pointer F and tail pointer L. For each operation, determine whether it can be done using only F, L, and a constant number of node accesses, or whether it requires traversing the list from the head to find a predecessor node.

Reviewed by ISRO IQ Editorial Team.