Register now or log in to join your professional community.
Stack is a data-structure which maintains its elements as last-in-first-out. You can imagine a stack as some rocks on each other, so you cannot remove the elements in the bottom without removing first the elements at the top. This order is very important in computer, especially when dealing with function calls and math inductions (recursion).
Heap is sometimes called (priority-queue), which is a type of queue that not fearly orders its elements. That is, in the natural queue, the first element enters the queue is the first one to go out. But in a heap, the first element goes out is the one having the most top priority, regardless of enetering first or last.