Interview Question Bank (1): Data Structure and Algorithm

linked list

  • Linked lists, common interview questions include writing an algorithm to delete a node in a linked list, reversing a singly linked list, and finding the intersection of two linked lists. This generally must be written completely without error;
  • Given the head nodes of two linked lists, find the intersection point of the two linked lists.
  • The difference between arrays and linked lists in Java and their respective advantages. How to design a linked list (skip list) with efficient random reading capabilities. Design a skip list, skip list insertion overhead, and skip list random reading process.
  • Give you a one-way linked list, perform K inversion on this linked list, for example k=3 1 -> 2 -> 3 -> 4 -> 5 -> 6. After inversion, it is: 3 -> 2 -> 1 -> 6 -> 5 -> 4 The length of the linked list is guaranteed to be a multiple of K
  • Given a linked list, return the first node where the linked list begins to enter the loop.
  • n descending linked lists return a linked list composed of the first K large nodes
  • Linked list merging: Given n ordered linked lists, merge them into an ordered linked list.
  • There are k ordered singly linked lists, how to merge them into one ordered singly linked list?
  • The reverse order of the linked list cannot be achieved by modifying the pointer, so how can it be achieved using recursion.
  • Reverse singly linked list
  • Do you know how to flip a doubly linked list?
  • There are two numbers that are very large and exceed the range of the long type. Now they are stored in the form of a linked list. The head of the linked list represents the highest digit. For example, 1->2->3->4 represents 1234. Please design an algorithm to find the sum of the two numbers. and;
  • Reverse numbers, cannot turn numbers into strings
  • Find rings in linked list

Supongo que te gusta

Origin blog.csdn.net/cq20110310/article/details/133187639
Recomendado
Clasificación