Pregunta de entrevista de Entrust

What is the difference between a stack and a heap?

Respuesta de la entrevista

Anónimo

12 de oct de 2022

The stack is used to keep track of the execution order of the program, such as functions. It is First In Last Out (FILO). The stack is also used for some variables such as arrays, which is why resizing, removing, and inserting array elements is an intensive task. The heap is used to store the program's memory, such as variables.