Queue of data structure, detailed knowledge

catalog:What is a queue?What are the characteristics of queues?Queue noun descriptionDetailed explanation of queue typesQueue operationText:What is a queue?Queue is a special linear table, which is only allowed at the front of the table( front)Delete, but at the back end of the table( rear)Like the stack, a queue is a linear table with restrict ...

Posted by plaggypig on Mon, 29 Nov 2021 19:47:13 -0800

Computer exercises

13. Given two strings containing only lowercase letters, calculate the length of the maximum common substring of the two strings. Note: the definition of substring refers to a string formed after deleting some prefixes and suffixes (or not deleted). import java.util.*; public class Main{ public static void main(String[] args) { Sca ...

Posted by wesley1189 on Mon, 29 Nov 2021 13:41:36 -0800

Tagging education re learning data structure and algorithm 13 | sorting: Principle Analysis and advantages and disadvantages comparison of classical sorting algorithm

Learning resources: Pull hook Education What is a ranking problem Sorting - the process of turning a group of unordered data into order. Generally, the order here is from small to large by defaultMeasure the advantages and disadvantages of a sorting algorithm Time complexity - specifically, the best time complexity, the worst time complexi ...

Posted by barnbuster on Mon, 29 Nov 2021 07:52:34 -0800

04_JavaScript data structure and algorithm queue

JavaScript data structure and algorithm (IV) queue Cognitive queue Queue is a linear table with limited operation. Its feature is first in first out. (FIFO: First In First Out) Limitations: Deletion is only allowed at the front of the table.Insert operations are only allowed at the back end (rear) of the table. Scenes similar to queue stru ...

Posted by unknown on Sun, 28 Nov 2021 23:13:14 -0800

Machine design (mountain climbing)

Title Description: let a machine be controlled by n It consists of two parts, and each part can be m From different suppliers. supplier j Supplied parts i With weight Wij And price Cij . Design an algorithm to solve the total price does not exceed the upper limit c The minimum weight of the machine. (design a branch a ...

Posted by ptolomea on Sun, 28 Nov 2021 13:15:28 -0800

PTA: save 007 (upgraded) (30 points)

Title:   In the old movie "Live and Let Die", there is a plot in which 007 is caught by a drug dealer on an island in the center of an crocodile pool. He uses an extremely bold way to escape - directly stepping on the brain bags of a series of crocodiles in the pool and jumping ashore! (it is said that the stuntman was bitten by ...

Posted by heropage on Sun, 28 Nov 2021 10:37:26 -0800

Circular linked list and bidirectional linked list

1, Foreword The sequential storage structure of linear table (such as array) has continuous storage space, so we don't have to worry about the logical relationship between elements. The biggest advantage of linear table is that it can quickly access the elements at any position in the table. The disadvantage of linear table sequential storage ...

Posted by tonchily on Sun, 28 Nov 2021 10:17:26 -0800

lettcode algorithm problem punch in - day05

Maximum depth of binary tree Given a binary tree, find its maximum depth. The depth of the binary tree is the number of nodes on the longest path from the root node to the farthest leaf node. explain:   A leaf node is a node that has no children. Example: Given binary tree [3,9,20,null,null,15,7],     3    / \   9  20     /  \    15 ...

Posted by riwan on Sun, 28 Nov 2021 08:52:54 -0800

Depth first traversal of adjacency table and adjacency matrix (with code debug and detailed comments)

Attach the program effect first: Adjacency table: Adjacency matrix, that is, a two-dimensional array is used to store the relationship between each vertex and the corresponding edge. For example, if there are edges between two vertices, set the subscript corresponding to this two-dimensional array to a non-zero value. As shown below: Undirec ...

Posted by airdee on Sun, 28 Nov 2021 05:30:10 -0800

Stack and queue Title Records

Recorded on November 28, 2021 Next up was the last blog post on stacks and queues Stack and queue title record (I) 232. Implement queue with stack Idea: this topic is a simulation problem to investigate the understanding of stack and queue. Because the stack is Filo (can only enter and pop up at the top of the stack), and the queue is FIFO ...

Posted by jkraft10 on Sun, 28 Nov 2021 05:27:16 -0800