C++---stack & queue & adapter mode & priority queue & imitation function

catalogue 1, Container adapter 1. What is an adapter? 2, Introduction and use of stack and queue 1. Introduction to stack 2. Use of stack 3. Introduction to queue 4. Use of queue 3, deque's brief introduction (understanding) 1. Principle of deque 2. Defects of deque 4, Simulation of stack and queue 1. Simulation Implementation of st ...

Added by jasonhardwick on Fri, 04 Mar 2022 22:03:33 +0200

[ACWing]1131. Save Private Ryan

Title address: https://www.acwing.com/problem/content/description/1133/ In 1944, special forces Mike received an order from the Ministry of defense to rush to an isolated island in the Pacific Ocean to rescue Private Ryan captured by the enemy. Ryan was imprisoned in a maze with complex terrain, but fortunately Mike got the topographic map of ...

Added by systemtek on Thu, 03 Mar 2022 16:23:46 +0200

Stack and queue exercise sorting

catalogue 1, Bracket matching problem 2, Implement a minimum stack 3, Implement queue with stack 4, Implement stack with queue 4.1} implement stack with two queues 4.2 implementing stack with a queue 5, Design cyclic queue 6, Next larger element 1, Bracket matching problem The title is described as follows: Solution idea: use th ...

Added by kettle_drum on Sat, 19 Feb 2022 21:41:16 +0200

[data structure from bronze to king] Part 4: queue of data structure

Catalogue of series articles preface 1, Concept and structure of queue 1. Concept of queue Queue: a special linear table that only allows inserting data at one end and deleting data at the other end. The queue has a first in first out FIFO(First In First Out) into the queue: the end of the queue where the inserting operation i ...

Added by PoOP on Sat, 19 Feb 2022 00:57:44 +0200

Data structure: wonderful journey of stack and queue (picture and text show you the charm of stack and queue)

Stack Definition: a stack is a linear table whose insertion and deletion operations are limited to one end of the table. It is usually called the top of the stack and the bottom of the stack. When there are no elements in the table, it is called empty stack. Example: suppose stack S=(a1, a2, a3,... an), then a1 is called the bottom element ...

Added by micbox on Fri, 18 Feb 2022 13:17:53 +0200

Concurrent linkqueue Java programming

brief introduction In concurrent programming, we sometimes need to use thread safe queues. If we want to implement a thread safe queue, there are two ways to implement it, one is to use blocking algorithm, the other is to use non blocking algorithm. The queue using blocking algorithm can be implemented by one lock (the same lock for queue entr ...

Added by freddyatlantis on Fri, 18 Feb 2022 00:50:27 +0200

Search algorithms DFS, BFS, backtracking

Deep search Deep search DFS. When a new node is found, it will immediately traverse the new node. It needs to use stack implementation or recursive implementation equivalent to stack. If the parent node of the traversal loop has a different record, it can also be used to detect each parent node. Sometimes we may need to mark the nodes ...

Added by meltingpotclub on Fri, 11 Feb 2022 07:32:19 +0200

Sword finger offer related exercises (3 ~ 10)

catalogue Title: Sword finger offer03: repeated numbers in the array Title: Sword finger offer04: search in two-dimensional array Title: Sword finger offer05: replace spaces Title: Sword finger offer06: print linked list node information from end to end Title: Sword finger offer07: reconstruction of binary tree (pre order + middle order) ...

Added by Fusioned on Thu, 10 Feb 2022 12:33:27 +0200

Super detailed analysis of [data structure] tree and binary tree

This article is long. You can click the directory below to view the corresponding content. I tree 1. Basic concepts    tree is a nonlinear data structure, which consists of n nodes and a set with hierarchical relationship. In fact, it is a big tree growing upside down, with many leaves added to one root.   the tree must con ...

Added by jhonrputra on Tue, 08 Feb 2022 15:24:34 +0200

ReentrantLock reentrant lock

Synchronized is called implicit Lock, also known as JVM Lock, because it holds and releases locks implicitly without developer intervention. Java 1.5 introduces a new locking mechanism, in which the implementation of the Lock is based on the Lock interface: public interface Lock { // Lock void lock(); // Unlock void unlock(); // The lock ...

Added by kjl-php on Mon, 07 Feb 2022 23:16:38 +0200