Pergunta de entrevista da empresa Entrust

What is the difference between a stack and a heap?

Resposta da entrevista

Sigiloso

12 de out. 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.