In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
The editor will share with you what the stack refers to in the computer. I hope you will get something after reading this article. Let's discuss it together.
The stack in the computer, also known as the stack, is a kind of linear table with limited operation, which defines the linear table that inserts and deletes only at the end of the table. This end is called the top of the stack, and relatively, the other end is called the bottom of the stack. Inserting a new element into a stack is also known as entering, entering, or pressing the stack, which puts the new element on top of the element at the top of the stack, making it a new top element.
Stack, also known as stack, is a linear table with limited operations. Qualifies linear tables that insert and delete only at the end of the table. This end is called the top of the stack, on the contrary, the other end is called the bottom of the stack. Inserting a new element into a stack is also called entering, entering, or pressing the stack. It puts the new element on top of the stack and makes it a new top element. Removing an element from a stack is also called making a stack or unstack. It removes the top element of the stack and makes its adjacent elements a new top element of the stack.
Basic concept
To understand this concept, we must first understand the original meaning of "stack", so that we can grasp the essence. "stack", the place where goods are stored or accommodation for passengers can be extended to warehouses and transit stations, so it is introduced into the computer field, which refers to the place where data is temporarily stored.
First of all, the reading and insertion of data content in the system or data structure stack (pressing push and popping up pop) are two different things! Press in is to add data, pop up is to delete data, these operations can only start from the top of the stack, that is, the lowest address as a constraint interface, but reading the data in the stack is random, there are no interface constraints. Many people misunderstand this idea and get confused about the stack. In the computer architecture, the system stack acts as a medium area for cross-component interaction, that is, the communication channel between cpu and memory. Cpu only reads and executes instructions linearly from the stack entry specified by the application program written by the system to ourselves, and uses a visual word to describe it as pipeline (pipeline, pipeline). For more information on cpu internal interactions, please see the introduction to the concepts of EU and BIU.
As a data structure, stack is a special linear table that can only insert and delete at one end. It stores data according to the first-in-first-out principle, the first-in data is pressed into the bottom of the stack, the last data is at the top of the stack, and the data pops up from the top of the stack when it needs to be read (the last data is read out first). The stack has the function of memory, and there is no need to change the pointer at the bottom of the stack in the insertion and deletion of the stack.
A stack is a special linear table that allows inserts and deletions on the same side. One end that allows insert and delete operations is called the top of the stack (top), and the other end is the bottom of the stack (bottom); the bottom of the stack is fixed, and the top of the stack is floating; 00:00 in the number of elements in the stack is called empty stack. Insertion is generally called PUSH, while deletion is called POP. The stack is also known as a first-in-first-out table.
The stack can be used to store breakpoints when a function is called, and it is used for recursion!
The above definition is explained in classical computer science.
In a computer system, the stack is a dynamic memory area with the above properties. The program can push the data into the stack or pop up the data from the top of the stack. In i386 machines, the top of the stack is located by a register called esp. The stack pressing operation reduces the address at the top of the stack, and the pop-up operation increases the address at the top of the stack.
Stack plays an important role in the operation of the program. The most important thing is that the stack holds the maintenance information needed for a function call, which is often called a stack frame or activity record. Stack frames generally contain the following information:
1. Return address and parameters of the function
2. Temporary variables: including non-static local variables of the function and other temporary variables automatically generated by the compiler.
After reading this article, I believe you have a certain understanding of "what the stack in the computer refers to". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for your reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.