Niuke video summary 5 (binary tree)

Niuke video summary 5 Binary tree first order, middle order and second order traversal First order traversal: first print the current node, then print the whole left subtree, and then print the right subtree Middle order traversal: first print the left node, then the current node, and then the right node Post order traversal: print the le ...

Posted by big_al on Fri, 25 Feb 2022 17:12:03 +0100

20220225_ Datawhale 34_ leetcode_7 double pointer

Seven double pointers 1.1 Foundation Collision pointer: refers to two pointers, left and right, pointing to the first element and the last element of the sequence respectively, and then the left pointer increases and the right decreases until the values of the two pointers Collide (i.e. left == right), or meet other special conditions. ...

Posted by ldougherty on Fri, 25 Feb 2022 09:24:46 +0100

[data structure and algorithm] unidirectional ring linked list and Josephu ring

Josephu Joseph Ring – the leading out of one-way ring linked list Josephu's problem is: let n people with numbers 1, 2,... N sit around. It is agreed that the person with number k (1 < = k < = n) will count from 1, and the person who counts to m will be listed. Its next person will count from 1, and the person who counts to m will ...

Posted by mvd7793 on Thu, 24 Feb 2022 19:00:53 +0100

Leetcode notes -- Introduction to greedy algorithm

Catalogue of series articles I Array type problem solving method 1: dichotomy II Array type problem solving method 2: Double finger needle method III Array type problem solving method 3: sliding window IV Array type problem solving method 4: simulation V The basic operation and classic topics of the linked list Vi Classic title of hash tab ...

Posted by hopelessX on Thu, 24 Feb 2022 13:02:34 +0100

Plist in Linux -- a two-way linked list with descending priority

plist https://elixir.bootlin.com/linux/v4.9.59/source/include/linux/plist.h#L212 *Descending priority sorted double linked list plist is a list of nodes sorted by priority; The priority of each node is from INT_MIN to INT_MAX (minimum). The time complexity of inserting is O(k), the time complexity of deleting is O(1), and the time complexit ...

Posted by Daggeth on Wed, 23 Feb 2022 10:21:51 +0100

Day 5 of Leetcode algorithm Introduction (double pointer)

876. Intermediate node of linked list Title Description Given a non empty single linked list with head node, return the intermediate node of the linked list. If there are two intermediate nodes, the second intermediate node is returned. Sample Input:[1,2,3,4,5] Output:[3,4,5] Explanation: the returned node value is 3 (The serializatio ...

Posted by eazyefolife on Wed, 23 Feb 2022 09:54:43 +0100

Chapter II linearity table

1, Definition (logical structure) and basic operation (operation) of linear table Definition: a linear table is a finite sequence of n (n > = 0) data elements with the same data type, where n is the table length. When n = 0, the linear table is an empty table. If L is used to name the linear table, it is generally expressed as L = (a1 , a2 ...

Posted by elgordo1960 on Mon, 21 Feb 2022 11:50:09 +0100

Introduction to C + + language learning -- linked list, queue and stack

[PS] I learned it in school, and I have learned it in Xinjing before. This blog is only used as personal knowledge sorting and backup. If there are mistakes, please help point out, thank you! The citation of this article is basically from Starting Out with C++ From Control Structures Through Objects 8th Global Edition 1. Linked List 1.1 ...

Posted by Solar on Sun, 20 Feb 2022 18:39:26 +0100

Leetcode's notes -- the combinatorial problem of backtracking algorithm

Catalogue of series articles I Array type problem solving method 1: dichotomy II Array type problem solving method 2: Double finger needle method III Array type problem solving method 3: sliding window IV Array type problem solving method 4: simulation V The basic operation and classic topics of the linked list Vi Classic title of hash tab ...

Posted by Jack McSlay on Sun, 20 Feb 2022 18:27:37 +0100

[java] LinkedList inserts faster than ArrayList

1. General Reprint: Manual of facial classics Chapter 8 "LinkedList inserts faster than ArrayList? Are you sure?" 2. Data structure Linked + List = linked list + list = linked list LinkedList is implemented based on linked list. Data nodes are interspersed by two-way chains next and prev. Therefore, when inserting data, you do ...

Posted by Peggy on Sun, 20 Feb 2022 14:25:14 +0100