当前位置:网站首页>The difference between heap and stack
The difference between heap and stack
2022-07-05 04:55:00 【yaohuiyaoo】
1. What is stack?
Stack is an ordered memory array .
2. The stack can store the value of variables , The execution environment of the program , Parameters passed to method
3. Data can only be inserted and deleted from the top of the stack , Put the data on the top of the stack for stacking , Delete the data as out of stack
4. What is a heap
Disordered memory area of heap , It can be deposited and removed in any order , although Can save data , But it cannot be explicitly deleted .
Heap is different from stack
1. Stack can save code execution steps , The heap holds objects , Data etc.
2. The stack allocates memory space during compilation ; Heap allocates memory size according to program operation
3. The stack has the principle of first in, last out , And it is a continuous memory area ; The heap is disordered , A piece of discontinuous , Controlled and released by the user
边栏推荐
- 【Leetcode】1352. Product of the last K numbers
- XSS injection
- [Business Research Report] top ten trends of science and technology and it in 2022 - with download link
- SQLServer 存储过程传递数组参数
- 次小生成树
- 中国溶聚丁苯橡胶(SSBR)行业研究与预测报告(2022版)
- 2021 electrician Cup - high speed rail traction power supply system operation data analysis and equivalent modeling ideas + code
- [crampon programming] lintcode decoding Encyclopedia - 1100 strange printer
- 3dsmax scanning function point connection drawing connection line
- China needle coke industry development research and investment value report (2022 Edition)
猜你喜欢
CUDA Programming atomic operation atomicadd reports error err:msb3721, return code 1
Looking at Chinese science and technology from the Winter Olympics: what is the mystery of the high-speed camera that the whole people thank?
2022 American College Students' mathematical modeling ABCDEF problem thinking /2022 American match ABCDEF problem analysis
Solution of circular dependency
[groovy] closure (closure as function parameter | code example)
AutoCAD - graphic input and output
Thinking of 2022 American College Students' mathematical modeling competition
JVM 原理和流程简介
[PCL self study: feature9] global aligned spatial distribution (GASD) descriptor (continuously updated)
AutoCAD - workspace settings
随机推荐
AutoCAD - graphic input and output
Personal required code
中国金刚烷行业研究与投资预测报告(2022版)
[groovy] closure (closure parameter binding | curry function | rcurry function | ncurry function | code example)
Flutter 小技巧之 ListView 和 PageView 的各种花式嵌套
mysql審計日志歸檔
Manually implement heap sorting -838 Heap sort
[ideas] 2021 may day mathematical modeling competition / May Day mathematical modeling ideas + references + codes
【acwing】528. cheese
How much do you know about 3DMAX rendering skills and HDRI light sources? Dry goods sharing
C iterator
AutoCAD - Zoom previous
Solution of circular dependency
The 22nd Spring Festival Gala, an immersive stage for the yuan universe to shine into reality
【Leetcode】1352. 最后 K 个数的乘积
[groovy] closure (Introduction to closure class closure | closure parametertypes and maximumnumberofparameters member usage)
flutter 对象和列表
Wan broadband access technology V EPON Technology
[groovy] closure closure (customize closure parameters | customize a single closure parameter | customize multiple closure parameters | specify the default value of closure parameters)
3dsmax common commands