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 ...
user avatar
  • 35.1k
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 ...
user avatar
  • 551
23 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 ...
user avatar
16 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 (...
user avatar
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 ...
user avatar
15 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 ...
user avatar
  • 6,227
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: (()()) ([]{{}}[]) ...
user avatar
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 ...
user avatar
  • 381
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 ...
user avatar
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 ...
user avatar
8 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. ...
user avatar
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'...
user avatar
  • 9,032
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 ...
user avatar
  • 161
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 ...
user avatar
  • 221
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 ...
user avatar
  • 35.1k
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 ...
user avatar
  • 31.6k
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 ...
user avatar
  • 31.6k
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 ...
user avatar
  • 159
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 ...
user avatar
  • 6,227
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 ...
user avatar
  • 35.1k
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 ...
user avatar
  • 41
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 ...
user avatar
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 ...
user avatar
  • 1,253
4 votes

What are some good problems which can be solved with a queue?

The Shunting Yard Algorithm To go along with your example of evaluating RPN, you can convert infix notation into RPN with the Shunting Yard algorithm It uses both a stack and a queue, although the ...
user avatar
  • 331
4 votes

What are some good problems which can be solved with a queue?

Ideally, I would like some simpler problems which can be presented with even lesser background. Fortunately, queues are used often in everyday scenarios. If you're just trying to teach the general ...
user avatar
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 ...
user avatar
  • 35.1k
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 ...
user avatar
  • 31.6k
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 ...
user avatar
  • 321
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 ...
user avatar
  • 35.1k
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 ...
user avatar
  • 31.6k

Only top scored, non community-wiki answers of a minimum length are eligible