Heap, Stack, and Queue

hogeol·2022년 12월 26일
0

C/C++

목록 보기
8/9

Queue

First In First Out (FIFO)

Memory Space

**CODE Area**
- programmer's code executed in this space

**DATA Area**
- static variables, or global variables allocated in this space
- when program is terminated, this area is disappeared

**HEAP Area**

**STACK Area**

Heap

Called Dynamic memory space

  • Shaped like binary tree
    <data occupied from top to bottom, left to right>
  • Allocated from low address to high address
  • Users need to allocate or disallocate memory space
    <If users cannot using it, heap occupy memory space>

Stack

Last In First Out (LIFO)

  • It is space that saving function and local variables
  • allocated from high address to low address
  • size of memory is fixed
    <calculated when compile>
  • If memory operations terminated, memory space is returned

0개의 댓글