[sword finger offer] second layer
Stack push and stack sequence
Title Description:
Review the basic structure of the stack:
The stack structure is first in first out, last in first out Stack in sequence: [1,2,3,4,5] stack out sequence [4,5,3,2,1], does it belong to the same stack in and out sequence? There may be hints in the stack:
Idea:
Use a stack simulati ...
Added by remal on Tue, 04 Jan 2022 10:10:15 +0200
Data structure: jump linked list
Pay attention to the official account and exchange with each other. Search by WeChat: Sneak ahead.
What is a jump list
The balance data structures often used in development include B number, red black number and AVL number. But if you implement one of them, it is very difficult and takes time to implement. The jump linked list is a fast searc ...
Added by brianb on Tue, 04 Jan 2022 02:51:34 +0200
The fifth day of LeetCode (delete the penultimate node of the linked list)
Title Description
Give you a linked list, delete the penultimate node of the linked list, and return the head node of the linked list.
Advanced: can you try using one scan?
Example:
Input: head = [1,2,3,4,5], n = 2
Output:[1,2,3,5]
Input: head = [1], n = 1
Output:[]
Input: head = [1,2], n = 1
Output:[1]
preface
When operating th ...
Added by squiblo on Mon, 03 Jan 2022 23:58:00 +0200
Algorithm and data structure foundation < 4 > ---- dynamic data structure foundation of data structure foundation: linked list < 2 >
Linked list and recursion:
Last time Algorithm and data structure foundation < 4 > -- dynamic data structure foundation of data structure foundation: linked list < medium > We have made a preliminary study of recursion. At the end of the paper, it is mentioned that we must understand the macro semantics of recursion when writing th ...
Added by thz_new_york on Mon, 03 Jan 2022 23:27:45 +0200
Data structure experiment
1. [problem description]
There are n people sitting around a round table. Now start counting from the s person, count to the m person, then start counting again from the next person, and count to the m person again. Repeat until all people are listed. The Josephus problem is: for any given n, m, s, find the sequence table of n people obtained ...
Added by dajawu on Mon, 03 Jan 2022 11:37:05 +0200
Force chain pen test question -- just look at this one
catalogue
83. Delete the duplicate elements in the ascending linked list so that each element appears only once
82. Delete all nodes with duplicate numbers in the linked list
Sword finger offer22 Find the penultimate node in the lin k ed list
876. Find the intermediate node of the linked list. If there are two intermediate nodes, the second ...
Added by brandonr on Mon, 03 Jan 2022 05:32:48 +0200
2 / 8 linear table of data structure and algorithm
catalogue
2.1 definition and characteristics of linear table
2.2 case introduction
2.3 type definition of linear table
2.4 sequential representation and implementation of linear table
2.4 supplement: parameter transfer in C + +
Implementation of basic operation of sequence table
Write after:
2.1 definition and characteristics of linear ...
Added by shumway on Sun, 02 Jan 2022 12:16:27 +0200
[JDK source code] LinkedList source code analysis
LinkedList source code analysis
1. Introduction
Through the inheritance system, we can see that LinkedList not only implements the List interface, but also implements the Queue and Deque interfaces, so it can be used as a List, a double ended Queue, and of course, a stack.It can be seen from the inheritance system that LinkedList implem ...
Added by beboni on Sun, 02 Jan 2022 05:48:45 +0200
LeetCode 82. Remove Duplicates from Sorted List II - Linked List series question 11
Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked list sorted as well.
Example 1:
Input: head = [1,2,3,3,4,4,5]
Output: [1,2,5]
Example 2:
Input: head = [1,1,1,2,3]
Output: [2,3]
Constraints:
The number of nodes in the lis ...
Added by Viruthagiri on Sun, 02 Jan 2022 03:06:29 +0200
Data structure and algorithm (2-2) linked storage of linear list (single linked list, static linked list, circular linked list, two-way circular linked list)
catalogue
1, Single linked list
1. Storage mode
2. Insert
3. Delete
Total code:
II. Static linked list
1. Storage mode
2. Insert
3. Delete
4. Traversal
Total code:
3, Circular linked list
Total code:
4, Bidirectional circular linked list
1. Storage method:
2. Insert and delete
3. Forward traversal and reverse traversal
Total ...
Added by benrussell on Sat, 01 Jan 2022 21:41:04 +0200