Java: difference and comparison between ArrayList and LinkedList

preface The difference between ArrayList and LinkedList is often mentioned. A clear understanding of the difference between them is helpful to consolidate their basic development skills. Choosing the right data structure in the right place can help them write more high-quality code. Combined with their source code, this paper analyzes th ...

Added by cdxrevvved on Wed, 02 Feb 2022 09:49:40 +0200

Comparison of data structure heap + object in java version

On the first day of 2022, tiger, tiger, I wish you a happy year of the tiger!!! Here comes the first blog of the year catalogue 1. Questions raised 2. Comparison of elements 2.1} element comparison 2.2 comparison of objects 3. Comparison of objects 3.1 override equal of base class 3.2 comparison based on Comparble interface ...

Added by n000bie on Wed, 02 Feb 2022 06:15:16 +0200

Chapter four, stack and queue learning notes

Stack and queue: A stack is a linear table that is restricted to insert and delete operations only at the end of the table. We call the end that allows insertion and deletion as the top of the stack, the other end as the bottom, and the stack without any elements as an empty stack. The stack becomes a linear table of Last In First Out (LIFO st ...

Added by pistolfire99 on Wed, 02 Feb 2022 01:55:14 +0200

C language: L2-006 tree traversal (25 points)

1, Title Given the post order traversal and middle order traversal of a binary tree, please output the sequence of its sequence traversal. It is assumed that the key values are positive integers that are not equal to each other. Input format: The first line of input gives a positive integer N (≤ 30), which is the number of nod ...

Added by scottfossum on Wed, 02 Feb 2022 00:17:05 +0200

[C + +] [binary tree] [binary search tree] build a binary search tree class.

1, Key analysis 1. Insert node Inserting a node is relatively simple. You only need to judge the key value, replace the corresponding key value, or create a new key value. // Insert the node (key, value) into the binary search tree with node as the root, and use the recursive algorithm // Returns the root of the binary search tree ...

Added by dietkinnie on Tue, 01 Feb 2022 21:46:07 +0200

[C++] STL space Configurator

What is a space configurator? Space configurator is used to efficiently manage space (space application and recycling) for each container Why do I need a space configurator Implement vector, list, map and unordered in simulation_ Map and other containers, all places that need space are applied through new , although the code can run norm ...

Added by Kol on Tue, 01 Feb 2022 19:52:52 +0200

Algorithm of double pointer problem

Double pointers are mainly divided into two categories: fast and slow pointers and left and right pointers Speed pointer For the linked list problem, we can generally use the speed pointer to solve it The so-called speed pointer refers to using two pointers to advance at different speeds. There are two pointers that we can determine: Is there ...

Added by dreado on Tue, 01 Feb 2022 17:53:13 +0200

"Problem solution" Luogu-P3700 [CQOI2017] small Q form

P3700 [CQOI2017] table of small Q Description There is a table with infinite rows and columns. The rows and columns start with \ (1 \), and the \ (a \) row \ (B \) column has an integer \ (f(a, b) \); \(f(a, b) \) shall meet: \(\forall a, b \in \mathbb{N}^*, f(a, b) = f(b, a)\); \(\forall a, b\in \mathbb{N}^*, b\cdot f(a, a + b) = (a + b) \c ...

Added by PRSWeb on Tue, 01 Feb 2022 16:46:28 +0200

Common search algorithms

1 common search concepts Lookup refers to determining a data element whose keyword is equal to the given value in the lookup table according to a given value.A lookup table is a collection of data elements or records of the same type.Keyword is the value of a data item in a data element, also known as key value. The primary keyword can uniquel ...

Added by Swerve1000 on Tue, 01 Feb 2022 14:25:11 +0200

leetcode day 19 - 884438713209

Day 19 884 unusual words in two sentences A sentence is a string of words separated by spaces. Each word consists of only lowercase letters. If a word happens to appear once in one sentence but does not appear in the other sentence, the word is not common. Give you two sentences s1 and s2 and return a list of all the infrequently used words ...

Added by mahakmx on Tue, 01 Feb 2022 13:01:53 +0200