• ## Simple encapsulation of JS stack structure

Time：2021-7-3

Stack: an ordered set that follows the last in first out (LIFO) principle. The newly added or deleted elements are stored at the same end of the stack. We call it the top of the stack and the other end the bottom of the stack. In the stack, all new elements are close to the […]

• ## Restrictive data structure stack

Time：2021-7-2

1. Definition of stack 1.1 definition Stack is a linear table that only inserts and deletes at the end of the table.Top of stackThe end that allows insertion and deletion is called the top of the stack.Stack bottom: the other end corresponding to the top of the stack is called the bottom of the stack.Empty […]

• ## The largest rectangle in a histogram (monotone stack)

Time：2021-5-31

84. The largest rectangle in the histogram violence thinking Enumerate all the left and right boundaries, and then find the minimum value in the interval. Complexity O (n ^ 3) It takes too long, so the code is omitted Violence optimization Select a column as the height, and then spread left and right to ensure […]

• ## Notes on data structure basic knowledge of stack

Time：2021-5-29

3、 Stack 3.1 stack 3.1.1 definition of abstract data type stack Stack: limit the linear table to insert or delete only at the end of the table; The end of the table is calledTop of stackThe head end is calledStack bottom. Empty tables without elements are calledEmpty stack。 characteristic:Stack operation: the elements at the bottom […]

• ## C + + STL stack and queue

Time：2021-5-8

Stack and queue Header file #Include // queue #Include // stack Definition method //Parameters are data types stack s; queue q; Common operations //Stack operation: s. Empty() // is the element empty s. Size() // returns the number of elements in the stack   s. Pop() // delete the top of stack element without returning its […]

• ## Application scenario analysis and code implementation of stack

Time：2021-4-20

Stack A practical requirement of stack Please enter an expression formula:[7*2*2-5+1-5+3-3]Click calculate [as shown in the figure below] Excuse me: how does the bottom layer of the computer calculate to get the result? Note that it’s not a simple list of formulas, because we look at formula 722 – 5, but how does the computer […]

• ## Prefix infix suffix expression rules

Time：2021-4-19

expression Prefix expression (Polish expression) Prefix expressions are also called Polish expressions, and the operators of prefix expressions precede the operands Examples: (3 + 4) ×5-6 The corresponding prefix expression is- × + 3 4 5 6 Prefix expression evaluation Computer evaluation of prefix expression Scan the expression from right to left. When encountering a […]

• ## Analysis and implementation of inverse Polish calculator

Time：2021-4-18

We have completed a reverse Polish calculator, which is required to complete the following tasks: Enter an inverse Polish expression (suffix expression) and use stack to calculate the result Support parentheses and multi digit integers, because here we mainly talk about the data structure, so the calculator is simplified and only supports the calculation of […]

• ## Thought analysis and code implementation of infix to suffix expression

Time：2021-4-17

Infix expression to suffix expression As you can see, the suffix expression is suitable for calculation, but it is not easy for people to write it, especially when the expression is very long. Therefore, in development, we need to convert infix expression into suffix expression. The specific steps are as follows: Initialize two stacks: the […]

• ## STL_ Stack container

Time：2021-4-16

1、 Introduction to stack Stack is a first in last out (Filo) data structure with only one exit. The stack container allows adding elements, removing elements, and getting the top elements of the stack, but there is no other way to access other elements of the stack except the top. In other words, stack does […]

• ## Leetcode 84. The largest rectangle in the histogram | Python

Time：2021-4-14

84. The largest rectangle in the histogram Title Source: leetcode https://leetcode-cn.com/problems/largest-rectangle-in-histogram/ subject Given n non negative integers, used to represent the height of each column in the histogram. Each column is adjacent to each other and has a width of 1. Find the maximum area of the rectangle that can be outlined in the histogram. […]

• ## [four components of Android 10] series — activity’s “startup process”

Time：2021-4-3

preface Due to the large amount of code for source code analysis, the content display pages of most blog sites are narrow, and the display effects are extremely ugly. So you can also directly check thinking in Android to read this article. I hope this article can help you to sort out the startup process […]