Data Structures for Pre-College Programmers: Stacks and Queues
Do you see issues with this article? Let us know.
Comments
April 01, 2013 01:03 PM
April 01, 2013 03:58 PM
Just pointing a typo: "In C++ this is called a prioirty_queue."
Thanks, typo fixed. Automatic spell checking does't work to well on names like that. :-/
April 01, 2013 07:13 PM
I liked the article, but I wanted to note on a minor mistake:
"Under the hood, a stack often implemented as a dynamic array."
should be:
"Under the hood, a stack is often implemented as a dynamic array."
April 01, 2013 09:36 PM
I wouldn't say a stack is not a fundamental data structure since it's the basis for call and return of functions and recursion.
April 01, 2013 10:12 PM
Perhaps a different definition of fundamental.I wouldn't say a stack is not a fundamental data structure since it's the basis for call and return of functions and recursion.
That isn't the definition I meant.
Yes, it is frequently used. It is something that should be understood. In that definition of fundamental you are correct.
In science and mathematics, fundamental has another meaning. Something is fundamental when it cannot be reduced into simpler parts.
For example, a fundamental frequency is the lowest frequency that contains all the harmonic frequencies. In chemistry atoms are fundamental because they cannot be broken down; molecules are not fundamental because they can be broken down into two or more atoms. In particle physics an electron is a fundamental particle because it cannot be broken down, but neutrons and protons are not because they can be broken down into quarks. The major trig functions can all be broken down into variations on the sin function, which is fundamental.
A stack can be broken down: it is any linear structure that follows a specific access pattern.
Because it can be broken down, stack is not fundamental.
Hopefully that doesn't cause too much confusion. :-)
April 01, 2013 11:11 PM
This article is very clear. Thank you so much for that. Words like stack and queue scared me. Now that I have the concept, I can talk with the pros. Haha. I do need to read it again to get it to soak in. Thanks!
November 07, 2013 03:32 PM
This is part of a series of articles dealing with data structures for beginners. It covers stacks and queues.
Advertisement
Recommended Tutorials
Other Tutorials by frob
177101 views
Advertisement
Just pointing a typo: "In C++ this is called a prioirty_queue."
The article itself seems reasonable, although I'm a bit mixed about the amount of depth even when considering the possible audience. A section for recommended reads at the bottom?