Question d’entretien chez MDA

What's the difference between a stack and a heap

Réponse à la question d'entretien

Utilisateur anonyme

31 oct. 2015

Stack is a LIFO date structure; when one extracts data from it, it will be in the reverse order that the data was pushed onto it. Heap is a tree data structure where the root node is always either the largest, or smallest element. Taking elements out of the heap is O(1). Putting elements into the heap is O(log n)

2