Concept:
• When a program is loaded into memory as a process, it is divided into logical segments.
• In a standard UNIX process layout, memory addresses increase from "bottom" (low addresses) to "top" (high addresses).
Step 1: Identify the bottom-most segment (B)
The Text segment (code) is placed at the lowest memory addresses to prevent it from being overwritten by heap or stack growth.
Step 2: Identify the segment above code (C)
The Data segment (containing initialized and uninitialized global/static variables) is placed immediately above the text segment.
Step 3: Identify the dynamically growing segment (D)
The Heap is used for dynamic memory allocation (e.g., malloc in C). It starts above the data segment and grows "upwards" toward higher addresses.
Step 4: Identify the top-most segment (A)
The Stack is used for local variables and function calls. It is placed at the very top of the available address space and grows "downwards" toward the heap.
Step 5: Arrange the sequence from bottom to top
The correct order is Text (B) $\rightarrow$ Data (C) $\rightarrow$ Heap (D) $\rightarrow$ Stack (A).