Linked list - learning notes

catalogue Knowledge points: Code template summary: Question: reference: Knowledge points: Linked list: a linear structure in which pointers are connected in series. Each node contains a pointer field and a data field. Type: single linked list (each node points to the next node), double linked list (each node refers to the forward node ...

Added by henryblake1979 on Sat, 05 Mar 2022 14:24:20 +0200

Three hundred rows per day (13 days: linked list)

Three hundred rows per day (13 days: linked list) Note: here are the synchronous notes and records of JAVA self-study and understanding. If you have any questions, please correct them 1, About linked list The logical structure and physical structure of the linked list are not as close as the sequential list. The physical storage of the ...

Added by davidlenehan on Fri, 04 Mar 2022 16:56:57 +0200

Implementation of hash table

1. Hash table Note 1 Note 2 Hash table (also known as hash table) is a data structure that is accessed directly according to the key value. That is, it accesses records by mapping key values to a location in the table to speed up the search. This mapping function is called hash function, and the array storing records is called hash table. Hash ...

Added by dcole on Fri, 04 Mar 2022 08:31:02 +0200

6 string, tuple and dictionary

Strings, tuples, and dictionaries 1, String A string is an immutable sequence of several different unicode characters 1 . String creation #Single quote string str1 = 'It's going to rain. My mother wants to get married. Let him go' str2 = str() #Empty string str3 = str([10,20,30]) #Double quoted string str2 = "It's going to rain. My mother ...

Added by James Bond 007 on Thu, 03 Mar 2022 20:32:23 +0200

Sword finger Offer 62 The last remaining number in the circle (java implementation) -- three solutions (violence, linked list, Mathematics) LeetCode -- Joseph Ring problem

Title: The N numbers 0,1, ····, n-1 are arranged in a circle, starting from the number 0, and the m-th number is deleted from the circle each time (counting from the next number after deletion). Find the last number left in the circle. For example, the five numbers 0, 1, 2, 3 and 4 form a circle. Starting from ...

Added by guyfromfl on Wed, 02 Mar 2022 17:33:18 +0200

Stack and Queue

Stack Stacks and queues can be considered restricted versions of arrays and linked lists. application parenthesis matching Problem Description: match the left and right parentheses of a string. Problem solving idea: enter the stack when you encounter the left parenthesis. In case of right parenthesis, it will be out of the stack. If th ...

Added by Lauram340 on Mon, 28 Feb 2022 16:29:22 +0200

[408 data structure] tree

The main reason for the tree is that there are too many application questions. (the algorithm problem has only been tested twice, which is very simple. It is a traversal; the algorithm problem is in the next article) Mind map Basic concepts Develop habits: distinguish between degrees and sum of degrees: Number of nodes = total degree + ...

Added by smokinjoe on Sat, 26 Feb 2022 16:57:20 +0200

Leetcode notes -- basic topics of dynamic programming

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 ...

Added by Redapple on Fri, 25 Feb 2022 15:35:16 +0200

Detailed explanation of stack usage

1, Demand Please enter an expression calculation formula: [722-5 + 1-5 + 3-3] Click calculation [as shown below] Excuse me: how does the bottom layer of the computer calculate the result? Note that it is not a simple operation to list the formula, because we look at the formula 7 * 2 * 2 - 5, but how the computer understands the formula (for ...

Added by Punk Rock Geek on Thu, 24 Feb 2022 10:14:23 +0200

leetcode basic programming: linked list

148. Remove linked list elements Difficulty: simple Collection Give you a head node of the linked list and an integer val. please delete all nodes in the linked list that meet the requirements Val = = Val node and returns a new header node. Example 1: Input: head = [1,2,6,3,4,5,6], val = 6 Output: [1,2,3,4,5] Example 2: Input: head = [], va ...

Added by vronsky on Wed, 23 Feb 2022 12:48:47 +0200