Skip to content

Latest commit

 

History

History

LinkedLists

  1. Write code to remove duplicates from an unsorted linked list.
    • FOLLOW UP, How would you solve this problem if a temporary buffer is not allowed?
  2. Implement an algorithm to find the kth to last element of a singly linked list.
  3. Implement an algorithm to delete a node in the middle of a singly linked list, given only access to that node.
    • EXAMPLE
      • Input: the node c from the linked list a->b->c->d->e
      • Result: nothing is returned, but the new linked list looks like a->b->d->e
  4. Write code to partition a linked list around a value x, such that all nodes less than x come before all nodes greater than or equal to x.
  5. You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.add-two-numbers
  6. Given a circular linked list, implement an algorithm which returns node at the beginning of the loop.LoopInList
    • DEFINITION
      • Circular linked list: A (corrupt) linked list in which a node’s next pointer points to an earlier node, so as to make a loop in the linked list.
    • EXAMPLE
      • input: A -> B -> C -> D -> E -> C [the same C as earlier]
      • output: C
  7. Implement a function to check if linkedlist is a palindrome. isPalindrome
  8. Write a function to remove a single occurrence of an integer from a doubly linked list if it is present. doubleLinkDel
  9. Delete the Node at a Particular Position in a Linked List. delAtPosition
  10. Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. merge-two-sorted-lists
  11. Reverse a singly linked list. reverse-linked-list
  12. Merge k sorted linked lists and return it as one sorted list. merge-k-sorted-lists

Questions 1 to 7 have been taken from Cracking the Coding Interview

Questions 10, 11 are in Team blind's curated list of 75 questions from leetcode