List, Set, data structure, Collections

Learning objectives Be able to tell the characteristics of the List set Be able to say common data structures Be able to tell the characteristics of array structure Be able to tell the characteristics of stack structure Be able to tell the characteristics of queue structure Be able to tell the structural characteristics of one-way linked list ...

Added by sanchan on Sun, 30 Jan 2022 00:31:20 +0200

Branch and bound method | algorithm design and analysis 2

Note: Mr. Liu's notes on the content of algorithm design and analysis course this semester People who have to stick to it until the end feel great Besides, PPT is not well understood by the teacher behind the teacher. Of course, it may be because I am always distracted and make complaints about it. 🤔 Branch gauge Loading problem analysis 🚩 ...

Added by ninevolt1 on Thu, 27 Jan 2022 17:53:15 +0200

Java JUC concurrent linkedqueue parsing

Research on the principle of concurrent linkedqueueintroduceConcurrentLinkedQueue is a thread safe unbounded non blocking queue. The bottom layer uses one-way linked list to achieve thread safety. CAS is used for incoming and outgoing operations.The internal queue of ConcurrentLinkedQueue is implemented in the way of one-way linked list, in whi ...

Added by ben2k8 on Thu, 27 Jan 2022 12:23:55 +0200

Java JUC LinkedBlockingQueue parsing

Blocking queue LinkedBlockingQueueintroduceThe previous article introduces the non blocking queue concurrent linkedqueue implemented by CAS algorithm, and this article introduces the blocking queue LinkedBlockingQueue implemented by exclusive lock.The class diagram shows that the LinkedBlockingQueue is also implemented using a one-way linked li ...

Added by chadowch on Wed, 26 Jan 2022 15:15:34 +0200

The maximum value of the queue and the maximum value of the sliding window

Title Description Given an array num and the size k of the sliding window, please find the maximum value in all sliding windows. Example: Input: nums = [1,3,-1,-3,5,3,6,7], and k = 3 Output: [3,3,5,5,6,7] Explanation: Position {maximum value of sliding window ---------------               ----- [1  3  -1] -3  5  3  6  7       3  1 [3  -1  - ...

Added by numan82 on Tue, 25 Jan 2022 18:45:53 +0200

Priority queue

1. What is the priority queue??First, the priority queue is a queue. It also has all the properties of the queue.Secondly, the priority queue takes out the element with the highest priority every time.The interior of the priority queue is maintained by heap. Put the highest priority first.2. When will this queue be used??After reading the defin ...

Added by hannah415 on Sun, 23 Jan 2022 10:21:34 +0200

4 questions about priority queue priority_queue

The k-th largest element of the array Title Link There are two ways to use the heap: Use the small root heap with the size of the total number of elements. After k elements are popped, the top element of the heap is the k-largest element among all elements.Maintain a K-size large root heap, so that the first k largest elements of all e ...

Added by mikeabe on Thu, 20 Jan 2022 05:01:18 +0200

Source code analysis of PriorityQueue

catalogue Member variable Constructor add to Return queue header element / out of queue operation delete Analysis of bottom binary heap algorithm summary Talk about the heap sorting algorithm Member variable public class PriorityQueue<E> extends AbstractQueue<E> implements java.io.Serializable { private static fi ...

Added by kimbhoot on Mon, 17 Jan 2022 22:49:59 +0200

7-1 symmetrical sorting (25 points)

7-1 symmetrical sorting (25 points) The title comes from PTA You work for the albatross circus with a group of ugly stars as pillars. You have just completed a program that outputs their list in non descending order according to the length of the stars' name string (that is, the length of the current name is at least the same as that of th ...

Added by Eclesiastes on Mon, 17 Jan 2022 10:23:11 +0200

Data structure and algorithm analysis - queue

summary Baidu Encyclopedia: Queue is a special linear table, which only allows deletion at the front of the table and insertion at the back of the table. Like stack, queue is a linear table with limited operation. The end that performs the insertion operation is called the tail of the queue, and the end that performs the deletion operation ...

Added by MadnessRed on Sun, 16 Jan 2022 12:23:15 +0200