Data structure notes - single linked list and two-way linked list

This blog is a learning note written after learning according to the data structure tutorial of Shang Silicon Valley teacher in station b Some concepts and pictures are from videos. The code and screenshots are done by yourself. The focus of this blog is on the code comments written by yourself Shang Silicon Valley Java data structure and Java ...

Posted by ThunderLee on Mon, 13 Dec 2021 15:47:59 +0100

Linked list must brush questions: speed double pointer, linked list reverse, find the midpoint template·····

234. Palindrome linked list Very representative! It includes linked list traversal, fast and slow pointer, midpoint template, linked list data comparison and linked list inversion! Very representative class Solution { public boolean isPalindrome(ListNode head) { if(head == null || head.next == null) return true; // Fi ...

Posted by luisantonio on Mon, 13 Dec 2021 15:36:32 +0100

Modify the lazy list using epoch based reclamation (EBR, a method of domain specific reclamation)

As mentioned earlier, the biggest hidden danger of lazy list is logical deletion, but there is no physical deletion problem. Therefore, EBR first solve d this problem to him. I EBR modification int parse_delete(intset_l_t *set, val_t val) { node_l_t *pred, *curr; int result, validated, isVal; while(1) { //Init pred ...

Posted by jonmkim on Sat, 11 Dec 2021 07:53:27 +0100

Detailed explanation of JavaScript single linked list (add, delete, change, check and reverse order)

1,addNode(val): Add elements at the end of the linked list( val Is the value of the node. 2,Length(): The length of the linked list. 3,display(): Print the linked list. 4,ModifyValue(val1,val2): Replaces the specified value. 5,findValue(val): Finds the specified value,Return to its location. 6,DeleteValue(val): Deletes the specified no ...

Posted by stew on Thu, 09 Dec 2021 16:13:19 +0100

[LeetCode single linked list] merge two ordered linked lists (21)

1. Title Merge the two ascending linked lists into a new ascending linked list and return the head node of the linked list. The new linked list is composed of all nodes of a given two linked lists. 1.1 example Example 1 1 1 : ...

Posted by orionblue on Tue, 07 Dec 2021 18:17:49 +0100

Data structure array and linked list

1, Linear table 1. Linearity table The linear structure of an ordered sequence composed of data elements of the same type. The starting position of a table is called the header, and the ending position of a table is called the footer. Except that the first element has no direct precursor and the last element has no direct successor, ever ...

Posted by revbackup on Tue, 07 Dec 2021 08:18:30 +0100

Linked list (single linked list, double linked list) knowledge summary (including interview questions)

1, General introduction to linked list: 1. single linked list: Each linked list has a next pointer to the next node and a member to store values 2. Double linked list: Based on the single linked list, there is also a prev pointer to the previous node.   3. Summary: (1) Linked lists are stored as nodes (2) Each node contains the da ...

Posted by yuppicide on Mon, 06 Dec 2021 21:49:25 +0100

Mathematical knowledge: Euler function, fast power, extended Euclidean algorithm, Chinese remainder theorem

Euler function Solving Euler function by formula method Basic principle: O(n √ ai)     Example: Euler function given   n positive integers   ai, please find the Euler function of each number. Definition of Euler function 1 ∼ N and   N   The number of Coprime numbers is called the Euler function a ...

Posted by dirkie on Mon, 06 Dec 2021 05:44:18 +0100

Graph definition, graph storage, depth, breadth, first traversal,

Path: a sequence of vertices consisting of contiguous edges Path length: the sum of the number / weight of edges or arcs on the path Loop (loop): the first vertex and the last vertex are the same path Simple path: a path with different vertices except that the start and end points of the path can be the same Simple loop (simple loop): a pat ...

Posted by 947740 on Mon, 06 Dec 2021 04:37:22 +0100

Improved supernatural merge sorting algorithm

My original intention is to write a bottom-up merging algorithm, but it is too troublesome to give the head and tail coordinates or length of the subsequence segments of the sorting function every time, and whether the molecular sequence segments are odd or even. So I wonder if I can store the head and tail coordinates of each subsequence segme ...

Posted by guido88 on Sun, 05 Dec 2021 12:31:16 +0100