This main memory is 64 kilobytes and each byte is having its own address. Nowadays we are using the memory in GB’s like 4GB, 8GB, 16GB memory but to understand we have to take a small part of main memory and that’s why we are taking 64kilobytes of memory,Īs you can see in the above image, the first-byte address is 0 and the last byte address is 65535. In our entire discussion of this Data Structure and Algorithm course, we will be assuming that the size of the main memory is 64 kilobytes. The total number of bytes is 65536, this is nothing but 64*1024 that is 64 kilobytes. The corner most byte address is 0 and the upper corner byte’s address is 65536 i.e. The address will have just one value not like a coordinate system (x,y), it will have a single value.Įvery byte will have its own address. The thing to observe is that diagram we have drawn is two-dimensional but the addresses are single dimension addresses i.e. Let us say the address is started from 0,1,2,3,4,5,6,7 and goes on. Let’s assume the smaller boxes shown in the below diagram are bytes. That means the memory is divided into smaller addressable units called bytes. The smaller, smaller blocks shown in the below diagram represent a memory. For understanding the static vs dynamic memory allocation, first, we should understand what is memory. And finally, we’ll see the static memory allocation and dynamic memory allocation. how the program utilized that main memory. Then we will see how the program uses the main memory i.e.
how the main memory is utilized and how it looks like. Here, we will discuss the Main memory i.e. Please read our previous article where we discussed Physical vs Logical Data Structure. In this article, you will learn about Stack vs Heap Memory, or in other words, you will learn Static and Dynamic Memory Allocation. Stack vs Heap Memory (Static and Dynamic Memory Allocation)