Home > Back-end >  Order of the stack to empty
Order of the stack to empty

Time:09-18

Void ClearStack (SqStack & amp; S)
{
S.t op=S.b ase;
}

So you can empty, that have been used the space without a free? I remember the malloc is the heap space, space on the heap is to manually released

CodePudding user response:

Must be to free, just empty the stack here, no recovery of memory, may lead to memory leaks

CodePudding user response:

reference 1/f, Simple, Soft reply:
is certainly to be free, just empty the stack here, there is no recovery of memory, can lead to memory leaks


The data structure of the book are written in this way

CodePudding user response:

Book is just the sample effect, and different scenarios, it is necessary to take into account the different

CodePudding user response:

Need to release, if the program after empty stack, directly out of the, the system will be considering dynamic space to release your application

CodePudding user response:

Empty stack, is different from the destruction of the stack, after emptying means may be put in the data

CodePudding user response:

Sequence table refers to the distribution of a block of memory, like the array average is divided into several small elements, they will be used to store data
During the period of using, the order release table does not exist, it is allocated memory of the existence of fixed
You just according to before a subscript flags to determine the current several elements space by using the
Behind everything the subscript didn't mark only idle
Order form features of the specifications of the elements is consistent, so it is orderly arranged from memory,
So you can directly use subscript orientation to a certain element of memory
So it is convenient for you to find and modify a certain element content
But order table shortcomings is that your unused memory which will cause waste of
And every time want to insert and delete will also is very troublesome, need to do elements of displacement
  • Related