• ## The second phase of algorithm training — stack

Time：2021-1-23

Pat class a 1051 Title Description 1051 pop sequence (25 points) Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. […]

• ## Stack principle of go language

Time：2020-12-16

package main import “fmt” type StackNode struct { // data interface} Next * stackmode // next node } //Create chain stack func CreateStack(Data …interface{}) *StackNode { if len(Data) == 0 { return nil } s := new(StackNode) //Record the next node var nextNode *StackNode = nil for _, v := range Data { //1,2,3,4,5 //Create […]

• ## The basics of the stack

Time：2020-11-14

Stack What is a stack Stack operation Implement a stack class Application of stack Stack property privatization What is a stack A stack is a list of elements that can only be accessed from one end of the list (called the top). A common, real-life example is a tray stack in a cafeteria. Pallets are […]

• ## Inverse Polish expression evaluation Python vs golang

Time：2020-10-28

Stack has great advantages in some matching scenarios and is very computer-friendly Question surface Calculate the value of inverse Polish (suffix expression), integer division only retains the integer partOperator contains only”+”,”-“,”*”and”/”The operands may be integers or other expressions [“20”, “10”, “+”, “30”, “*”] -> ((20 + 10) * 30) -> 900 [“40”, “130”, “50”, “/”, […]

• ## Algorithm diagram: how to find the minimum value in the stack?

Time：2020-10-24

We learned a lot about stack, such asMoving diagram demonstration: two implementation methods of manual stack! “andHow can JDK implement stack like this? “Then let’s brush some classic interview questions about stacks to consolidate what we have learned. Our interview question today is like this subject Define the data structure of the stack, and implement […]

• ## Bytecode Foundation

Time：2020-9-18

Bytecode Foundation Virtual machine stack and stack frame Hotspot JVM is a stack based virtual machine. Each thread has a virtual machine stack to store stack frames. Each method call is accompanied by the creation and destruction of stack frames. The definition of Java virtual machine stack is shown in the figure When the stack […]

• ## What is a stack?

Time：2020-9-7

This paper introduces an important data structure stack, which is also a kind of data presentation just like the linked list and array mentioned beforeLinear arrangementIn this structure, we can only access the newly added data. A stack is like a stack of books. When we get a new book, we will put it on […]

• ## Chapter 1: stack of linear tables

Time：2020-9-1

Stack describe Restricted linear table, only one segment is allowed to be inserted and deleted characteristic First in, second out, last in, first out Cartaran number For the n-number stack sequence Stack interface /// <summary> ///Stack /// </summary> namespace DataStruct.Stack { /// <summary> ///Stack接口 /// </summary> interface IStack<T> { /// <summary> ///Out of the stack […]

• ## Redis syntax: Sets

Time：2020-8-17

1、 Increase 127.0.0.1:6379 > Sadd set01 1 2 3 3 4 5 // no error will be reported and the duplicate will be removed automatically (integer) 5 2、 Delete 127.0.0.1:6379 > SREM set01 2 // delete the (integer) 1 3、 Reform 127.0.0.1:6379 > smove set02 set01 7 // move 7 in set02 to set01 (integer) […]

• ## Chapter 1: linear table stack

Time：2020-5-23

Stack describe Limited linear table, only one segment can be inserted and deleted characteristic First in first out Kataran number For the stack sequence with n numbers Stack interface /// <summary> ///Stack /// </summary> namespace DataStruct.Stack { /// <summary> ///Stack接口 /// </summary> interface IStack<T> { /// <summary> ///Out of the stack /// </summary> ///< returns […]