Cards (33)

  • What is a linked list?
    A linear data structure with elements linked using pointers
  • Which of the following is NOT a type of linked list?
    Triangular Linked List
  • What is a key advantage of using linked lists over arrays?
    Dynamic memory allocation
  • What does a doubly linked list allow that a singly linked list does not?
    Traversal in both directions
  • In a circular linked list, the last node points to:
    The first node
  • Which operation is NOT typically performed on a linked list?
    Sorting
  • What is the primary disadvantage of linked lists compared to arrays?
    Higher memory usage due to pointers
  • Which of the following scenarios would benefit from using a linked list?
    When frequent insertions and deletions are required
  • What is the time complexity of inserting a node at the beginning of a linked list?
    O(1)
  • Which of the following best describes a node in a linked list?
    A single data element
  • What is the main purpose of the 'next' pointer in a linked list node?
    To link to the next node
  • Which type of linked list would you use if you need to frequently traverse both forwards and backwards?
    Doubly Linked List
  • What is the output of traversing a circular linked list?
    A finite sequence of nodes
  • Which of the following operations is most efficient in a linked list?
    Inserting an element at the beginning
  • What happens if you try to delete a node from an empty linked list?
    An error occurs
  • Which of the following is a real-world application of linked lists?
    All of the above
  • Which of the following best describes why dynamic memory allocation makes linked lists more efficient than arrays for insertions and deletions?
    Because nodes can be added/removed without shifting other elements
  • What potential challenge arises when implementing a circular linked list compared to a singly linked list?
    Detecting the end of the list
  • In a doubly linked list implementation, what is the key advantage of maintaining a previous pointer?
    Ability to traverse backwards
  • When would using a circular linked list be most appropriate?
    When data needs to be processed cyclically
  • What is the main disadvantage of using a linked list compared to an array for data storage?
    Higher memory usage due to pointer storage
  • In terms of memory efficiency, why might a singly linked list be preferred over a doubly linked list?
    It uses less memory per node
  • What is the time complexity of inserting a node at the beginning of a linked list?
    O(1)
  • Which operation becomes more efficient when using a doubly linked list instead of a singly linked list?
    Deletion of current node
  • What is the primary purpose of using a sentinel (dummy) node in a linked list?
    To simplify edge cases in operations
  • When implementing a linked list, what is the most critical aspect to manage to prevent memory leaks?
    Pointer assignments
  • What is the key consideration when choosing between a singly and doubly linked list implementation?
    Required operations
  • In what scenario would a circular linked list be less efficient than a regular linked list?
    When implementing a queue
  • What is the main advantage of using a linked list over an array when implementing a stack?
    Dynamic size management
  • Which operation typically requires more careful handling in a doubly linked list compared to a singly linked list?
    Node deletion
  • What is the most efficient way to reverse a singly linked list?
    Using three pointers
  • When implementing a linked list, what is the primary benefit of using a tail pointer?
    Efficient insertions at end
  • What problem does a circular linked list solve that a regular linked list cannot?
    Continuous cycling through elements