当前位置:网站首页>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
边栏推荐
- 2021 electrician cup (the 12th "China Society of electrical engineering Cup" National Undergraduate electrician mathematical modeling) detailed ideas + codes + references
- 【acwing】240. food chain
- Interface joint commissioning test script optimization V5.0 (end)
- [groovy] closure (Introduction to closure class closure | closure parametertypes and maximumnumberofparameters member usage)
- Number theoretic function and its summation to be updated
- 【acwing】836. Merge sets
- Create a pyGame window with a blue background
- Wan broadband access technology V EPON Technology
- Redis 排查大 key 的4种方法,优化必备
- #775 Div.1 C. Tyler and Strings 组合数学
猜你喜欢
3dsmax scanning function point connection drawing connection line
计组笔记(1)——校验码、原补码乘除计算、浮点数计算
A survey of automatic speech recognition (ASR) research
2022 American College Students' mathematical modeling ABCDEF problem thinking /2022 American match ABCDEF problem analysis
[Business Research Report] Research Report on male consumption trends in other economic times -- with download link
【acwing】836. Merge sets
[groovy] closure (closure call is associated with call method | call () method is defined in interface | call () method is defined in class | code example)
Introduce Hamming distance and calculation examples
Rip notes [rip three timers, the role of horizontal segmentation, rip automatic summary, and the role of network]
Is $20billion a little less? Cisco is interested in Splunk?
随机推荐
Flutter 小技巧之 ListView 和 PageView 的各种花式嵌套
[groovy] closure (closure parameter binding | curry function | rcurry function | ncurry function | code example)
Understand encodefloatrgba and decodefloatrgba
AutoCAD - feature matching
Autocad-- Real Time zoom
Fluent objects and lists
【Leetcode】1352. 最后 K 个数的乘积
[crampon programming] lintcode decoding Encyclopedia - 872 termination process
The difference between bundle, chunk and module
2021 electrician cup (the 12th "China Society of electrical engineering Cup" National Undergraduate electrician mathematical modeling) detailed ideas + codes + references
[groovy] closure (closure call is associated with call method | call () method is defined in interface | call () method is defined in class | code example)
Rip notes [rip message security authentication, increase of rip interface measurement]
Difference between singleton and factory pattern
China needle coke industry development research and investment value report (2022 Edition)
How much do you know about 3DMAX rendering skills and HDRI light sources? Dry goods sharing
介绍汉明距离及计算示例
Is $20billion a little less? Cisco is interested in Splunk?
Flink集群配置
Mode in BST (binary tree & Notes on question brushing)
3dsmax2018 common operations and some shortcut keys of editable polygons