Summary of common interview questions in linked list

1. Delete all nodes in the linked list equal to the given value val. If a node is no longer referred to by Java, it will be automatically deleted The linked list is as follows: The given value is assumed to be 3: Reference code: //Delete all nodes with the value of key public void removeAllKey(int val){ if(this.head == nul ...

Added by powah on Mon, 07 Feb 2022 08:45:21 +0200

Linear list - single linked list - array

Linear table Sequential list and linked list Abstract data structure - data combination and operation set Header node: the first node that does not store data elements First element node: the first node where data elements are stored 1, Definition of linear table A finite sequence of zero or more data elements There is order between elem ...

Added by novicephp on Mon, 07 Feb 2022 07:15:36 +0200

Fair Share (construction + Euler loop)

E. Fair Share [Link](Problem - E - Codeforces) meaning of the title Here you are m m m arrays and two multiple sets L , R L, R 50. R, i ...

Added by weaselandalf on Mon, 07 Feb 2022 06:21:19 +0200

Chapter 7, learning notes

A Graph is composed of a finite non empty set of vertices and a set of edges between vertices. It is usually expressed as: G(V,E), where g represents a Graph, V is the set of vertices in Graph G, and E is the set of edges in Graph G. Graph is a more complex data structure than linear table and tree. In the graph structure, the relationship bet ...

Added by LLeoun on Sun, 06 Feb 2022 23:13:55 +0200

Data structure learning, binary tree

catalogue Header file and macro definition to be referenced in advance Other data structures needed (chain stack and chain queue) The structure of the binary tree used (binary linked list) Its basic operation interface basic operation Create an empty binary tree Create a binary tree, where the value of the root node is e, and L and R ar ...

Added by fred_belanger on Sun, 06 Feb 2022 22:12:55 +0200

[on data structure] basic concept and function implementation of heap (full binary tree) (with source code)

1. Concept of reactor 1.1 definitions If there is a key set K = {k0, k1, k2,..., kn-1}, all its elements are stored in a one-dimensional array in the order of complete binary tree, and meet the following requirements: ki < = k2i + 1 and Ki < = k2i + 2, it is called small heap (or large heap). The heap with the largest root node i ...

Added by abselect on Sun, 06 Feb 2022 21:20:38 +0200

Algorithm brush questions [Luogu P1185] to draw binary tree

Whimsical journey: my original blog is completely knocked by hand, absolutely not carried, and there can be no repetition in the whole network; I don't have a team, I only share it for technology lovers, and all the content doesn't involve advertising. All my articles are only published in CSDN and personal blog (must be the domain name of fant ...

Added by snorcha on Sun, 06 Feb 2022 20:07:37 +0200

Link Cut Tree App Three

February 06, 2022, 17th 1. Title Link: P2542 [AHOI2005] Route Planning Ideas: L C T LCT LCT Plus Set Solution, Time Complexity O ( ...

Added by rash on Sun, 06 Feb 2022 19:11:23 +0200

Java from introduction to mastery seven (Java data structure -- collection Collection)

1: Collection overview What is the difference between a set and an array? Array is also a data structure in java. The length of data is fixed and the storage mode is linear. And it can store basic data types and objects. Basic data objects can be processed and stored according to the packing of basic types. Our array is of reference data ...

Added by lailaigogo on Sun, 06 Feb 2022 06:37:42 +0200

Hierarchical tree building and traversal of C + + binary tree

Summary Traversal: left and right roots first; Middle order traversal: left root right; Post order traversal: left and right roots.If you select a hierarchy to build a tree, you need a chained queue to assist the implementation (specify, don't ask why).The specific operation process of the auxiliary queue (key understanding): the data field p ...

Added by ccooper on Sun, 06 Feb 2022 05:35:49 +0200