31
votes
What are the advantages/disadvantages of teaching how to implement Nodes, Linked Lists, Stacks, and Queues before showing built-in implementations?
There is one aspect not yet mentioned, though the first two answers are excellent.
Libraries usually contain only the most common data structures and those that can be used in some generic way (pun ...
28
votes
What are the advantages/disadvantages of teaching how to implement Nodes, Linked Lists, Stacks, and Queues before showing built-in implementations?
Note: Initially my answer was just about computational complexity, but then it grew a bit, so I broke it into multiple sections and tweaked each a bit. Thanks to commenters for pointing out the ...
24
votes
Accepted
What are some good examples of using a stack data structure?
I once had to implement a limited undo function (undo changes to the current field, or addition/deletion of records).
The lists of undo deltas (one for field changes and one for records) were stored ...
17
votes
What are some good examples of using a stack data structure?
A stack of trays in a cafeteria. I also like the pole of rings analogy.
With the trays, you can pop (take a tray) and push (return it when you're done). You can see what the top tray (first item) is (...
16
votes
What are some good examples of using a stack data structure?
A rather interesting analogy is that of a firearms magazine.
if we look at this picture:
It is easy to see that bullets can be inserted from the top, and only the topmost bullet is accessible. Such ...
15
votes
What are some good examples of using a stack data structure?
The back button on a web browser is an excellent example of a stack implementation that is easily understood even by non-experts and easily demonstrated in a class. You can illustrate the stack in ...
14
votes
What are some good examples of using a stack data structure?
Check whether a string of parentheses is balanced or not.
For example, return True for these input strings:
(()())
([]{{}}[])
...
13
votes
What are the advantages/disadvantages of teaching how to implement Nodes, Linked Lists, Stacks, and Queues before showing built-in implementations?
In my experience, it is typical to have students make their own implementation first so that they understand what is going on "under the hood," so that they can make better choices for which structure ...
10
votes
What are some good examples of using a stack data structure?
I like the pez dispenser.
Also the stack of papers (where the actual human interaction is never to take the top item but rather to take the second from the top.
At some point you have to talk about ...
8
votes
How to teach students to work with multiple layers of abstraction?
Link to real life
“Who has came to school by bicycle?”
“OK so we need to know how to make a bicycle”
“What time did you get up? It must have taken a long time to build the bicycle?”
Take it to the ...
7
votes
What are some good examples of using a stack data structure?
The "real-life" examples are pretty clearly delineated here already, but since you asked for examples in programming as well, I'll add one to the list.
Stacks can be used to build calculators. There'...
7
votes
What are some good problems which can be solved with a queue?
One example I've used for students in the past is a shared printer.
If I have five people using a printer all at once I will have a problem if two of the five attempt to print at the same time. ...
6
votes
What are some good examples of using a stack data structure?
In practice, many calculators employ the Shunting Yard algorithm to evaluate mathematical expressions as per the rules of BODMAS. The algorithm makes use of stacks to push and pop operators based on ...
5
votes
What are some good examples of using a stack data structure?
This won't work for all students, but some will likely be familiar with the very popular collectable card game Magic: The Gathering.
In this game, spells are cast to "the stack", with the last spell ...
5
votes
First project in my second year data structures intro
Sorry, but digging in your heels or telling the students to wake the hell up is going to get you exactly nowhere. When a small percentage of your students fail to successfully complete a project it is ...
5
votes
Accepted
Textbook or video lectures to develope intuition for solving any unseen Graph Theory problems
I'm writing only a partial answer, because I currently lack time. That means that I'm not properly sourcing everything, and largely working from my own memory. I don't believe that anything I say ...
4
votes
What are some good examples of using a stack data structure?
Much of what has been said already is wonderful. I would like to point out that Mike's Pez dispenser visualization is brilliant, and lends itself to a direct lesson with manipulables. You can take a ...
4
votes
What are some good examples of using a stack data structure?
Here are couple of examples which don't employ objects resembling real-life stack:
Russian doll (matryoshka). It is a stack if you use the relationship ...
4
votes
How to teach students to work with multiple layers of abstraction?
Trial and error, as well as practice, are usually the best way to get students to be comfortable with anything.
"All" you have to do is give them time and plenty of opportunities to use multiple ...
4
votes
Is there any pedagogically motivated reason to teach quadratic probing?
Yes, you should at least introduce the idea to your students.
That said, it is also a truism of education that you need not explain every concept at the same level of detail. In this particular case ...
4
votes
What are the advantages/disadvantages of teaching how to implement Nodes, Linked Lists, Stacks, and Queues before showing built-in implementations?
Let me answer from the perspective of someone who recently completed a Data Structures and Algorithms course.
Background
My Data Structure course was taught using java applets two years ago. My ...
4
votes
What are the advantages/disadvantages of teaching how to implement Nodes, Linked Lists, Stacks, and Queues before showing built-in implementations?
I've seen too many students implementing linked lists, and then using linked lists of chars as buffers...
Of course at some point students have to understand how things work.
But novice programmers ...
4
votes
What are the advantages/disadvantages of teaching how to implement Nodes, Linked Lists, Stacks, and Queues before showing built-in implementations?
Assuming they will have a career in C#, you're right to assume that your students will likely never have to make their own queue or stack.
However, that's not the point of the lesson. The point of ...
4
votes
Accepted
First Time Learning Non-Linear Data Structures
I'm not sure this qualifies as an actual answer, but let me suggest that you give yourself a course in Structural Induction. Perhaps you already know of this, of course. But the main idea is that the ...
4
votes
Why might be the benefits of teaching data structure course in Python?
Since we're missing a lot of information, this answer will be fairly bare-bones.
There are no "right" or "wrong" answers here. Everything hinges on the goal of the course. And ...
4
votes
Accepted
Which is the best book for algorithms before I dive into Leetcode?
Cormen's, Leiserson's, Rivest's and Stein's Introduction to Algorithms and Data Structures is widely considered a most great book on the topic in question.
Even when googling "best algorithms ...
3
votes
How to teach students to work with multiple layers of abstraction?
tl;dr Build the layers with appropriate scaffolding, either top-down or bottom-up.
The goal is to understand an abstraction layer architecture. The teaching method is to have students build it layer ...
3
votes
How to keep students heads from exploding from complex, interconnected topics
Students are better able to handle structured information when they understand, at the start, what that structure is.
Explain the situation to your students. You are about to present a series of ...
3
votes
What are some good examples of using a stack data structure?
In my view, a good computer science example for stack-oriented processing is the PostScript language.
The Hello world example from the Wikipedia page shows the ...
3
votes
What are the advantages/disadvantages of teaching how to implement Nodes, Linked Lists, Stacks, and Queues before showing built-in implementations?
It find it extremely important to teach them the principles behind those (or similar) data structures first, and I'd go so far as to pick any one of the more complex ones as well (0/1-trees or even B-...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
data-structure × 26algorithms × 14
lesson-ideas × 3
self-learning × 3
resource-request × 3
programming × 3
java × 3
student-motivation × 2
undergraduate × 2
project × 2
data-types × 2
secondary-education × 2
teaching-analogy × 1
object-oriented-paradigm × 1
databases × 1
c × 1
artificial-intelligence × 1
active-learning × 1
lecture-tools × 1
cs-theory × 1
code-example × 1
complexity-theory × 1
c# × 1
graph-theory × 1
windows × 1