Last week we talked about a new abstract
data type that I have not studied before in high school – the stack data type.
At first I was confused about why do we use something like stack when we have
list. Aren’t lists more convenient to use? For example, the list class already
contained many useful functions – indexing, finding value etc. But as the
lecture went on I realized in some cases, list is actually a “overkill”, and
those useful functions just became a heavy load in the memory. By using stack,
we can effectively reduce memory usage thus increase the efficiency of the
program. In general, this is probably the most interesting concept I have heard
so far.
No comments:
Post a Comment