• 2022-06-03
    Heap与stack的差别?
  • Heap是堆,空间是由手动操作分配和释放的,它的存储区很大的自由存储区。 Stack是栈,是由是操作系统自动分配和释放的,栈上的空间是有限的。程序在编译期间变量和函数分配内存都是在栈上进行的,且在运行时函数调用时的参数的传递也是在栈上进行的。

    内容

    • 0

      How to use the heap to sort:如何用堆来实现排序: A: Continue to call delMax() after building a heap建堆后不断调用delMax() B: Continue to call getMax() after building a heap建堆后不断调用getMax() C: Continue to call insert() after building a heap建堆后不断调用insert() D: Build the heap建堆

    • 1

      对于类模板Stack,通过下面语句实例化之后,有________个实例类template class Stack; Stack charStack;

    • 2

      How to use the heap to sort:如何用堆来实现排序:- 未答 A: Continue to call delMax() after building a heap建堆后不断调用delMax() B: Continue to call getMax() after building a heap建堆后不断调用getMax() C: Continue to call insert() after building a heap建堆后不断调用insert() D: Build the heap建堆

    • 3

      名词解释:运行时堆( runtime heap)

    • 4

      A heap must be a full binary tree