You are probably being recorded (and transcribed) (if the technology is working correctly).
Start of class instructions
Greetings
Approximate overview
I don’t know what your prior experience with tokens is. I give them for academic/scholarly events, cultural events, peer events, wellness events, and a few other things. Only those I record in the daily eboards are available. Please log them within three days.
If you’d like to suggest token events, please let me know in advance of class.
Academic/Scholarly
Cultural
Multicultural
Peer
Wellness
Misc
I historically give a “Friday PSA” (public service announcement). Students have encouraged me to continue doing so. Unfortunately, our class does not meet on Fridays, so I will pretend that we’re a state school, and give you a Thursday PSA. If you find these annoying, let your class mentor know and they’ll tell me to stop.
How was Sam’s summer?
Difficult.
Can I transfer to section 1 which meets at 8:00 a.m.?
There’s one spot left.
Can you scroll up to the questions? [+2]
Yes.
Why do we use VS Code?
Because I like torturing students.
Because I asked some folks what to use and the consensus was VS Code. “Eclipse is old hat.” “IntelliJ is commercial software.”
Does Sam have hearing loss?
Yes, particularly at the upper range. And he forgot his hearing aids today.
What is Sam’s favorite passtime?
Snark.
Spending time with family. (Board and card games.)
What’s Sam’s favorite color?
Plaid.
If you could make a video game, what would you make?
Something implicitly educational. Or maybe freeform artistic.
What movie about technology should everyone watch?
Real Genius
What is Sam’s favorite snack?
Lamejun with yogurt
Favorite board/card game?
Card: Canasta
Board: Yacht Race, Carcassonne, RoboRally, Cosmic Encounter
Least favorite color?
I am red-green color deficient. There are some shades of green that I cannot distinguish from black. I hate those shades of green.
Have you seen any good movies lately?
No.
When did you first think of becoming a professor?
Possibly in college when I was TAing because it’s amazing to see an idea click in someone’s mind and know you contributed.
Also my mom was a professor and seeing the impact she had on her students was inspirational.
Favorite food?
Fruit
Least favorite food?
Nuts, because I’m allergic.
Was there a reading?
Yes. It was on the schedule. I thought it was also in the email. Did you not get the email?
Could you explain the relationship between traits, mixins, and Java’s forms of polymorphism?
Perhaps after we’ve discussed Java’s forms of polymorphism.
Maybe explain the concept of Polymorphism and Inheritance, because I remember learning it from CSC 161, but have forgotten some things that I don’t remember specifically.
We’ll do those in depth in a week or two.
How should we know what strategy to choose for SAM to be efficient? It feels like we can choose anything but I don’t understand the differences until I start writing the methods.
Our goal in ADT design is not efficiency; it’s to think through how we want to use the data. What do we want to be able to do? It’s only once we look at implementations that we start thinking about costs.
How does the Layout of LIA (or the Arrangement in AAA) affect the outcome? Is there anything specific to look out for when choosing the layout for ADT?
Different layouts will lead to different costs. We should see that when we explore different implementations of stacks.
I felt sloppy answering these questions. I mostly used what I knew from C, and I had trouble envisioning how this would work in an OO environment. If you could go into more detail about these data structures are implemented in Java that would be splendid.
We haven’t done any Java or OOP yet. I wouldn’t think that you’d approach them that way. We’ll look at them as C structures or functions for the time being. We’ll return to stacks and such in an OO model in a few weeks.
How would the basic data structures we learned in 161 (stacks and queues) be implemented within Java/OOP without using pseudo-code?
We’ll cover those in a few weeks, once we’ve learned about objects (and perhaps even generics).
For the arrangement question, what were you thinking about as “other data”?
For context, that question reads “Describe a way you might arrange a stack in memory. (You might represent the stack as a linked structure or an array; what other data would you store in each case?)”
If I were storing the stack as an array in C, in addition to the array, I would also store the size of the array (I might call that the “capacity” of the stack) and the number of elements in the stack.
struct StackOfStrings {
char **elements;
int capacity;
int size;
};
Although a linked implementation of stacks might only require one pointer, a linked implementation of queues often requires two (one for the front of the queue and one for the back of the queue).
I’ve read that there are 4 principles: Abstraction, Polymorphism, Encapsulation, Inheritance. The way the reading laid it out is a bit different: Encapsulation, Inheritance, Polymorphism, Composition. Especially in the Encapsulation part, it seems a bit difficult to differentiate between that and Abstraction. Can you go deeper into these 2?
Great question! Let’s wait until we’ve played with them a bit more.
If there is time maybe an example of a minimalist design ADT?
Yup, we’ll do that for stacks today.
If possible just re-explain how ADT and data structures work together
The ADT is the what. That is, what you want to do with your data. The data structure is the how. That is, how we achieve those goals.
Alternately, the ADT is the
.h
file and the data structure is the.c
file. At least that holds if we’re thinking about collections of values.
Get started learning how to be a computer scientist / software developer.
Don’t forget to ask me when I use a TLA that you don’t understand.
We will use the Think-Pair-Share (TPS) process. You’ve already thought to yourself (or should have, since it was an assignment). Now it’s time to pair with another person and discuss your answers. Then we will share with each other.
ADT: Use the SAM approach for ADTs.
Note: This used to be the PUM approach. I thought SAM was easier to remember.
We will assume that it’s a stack of strings. We will also assume that we’re implementing it in C.
Please make sure you consider parameters, return types, preconditions, potential questions the client of your stack might have, etc.
_I’ll divide your answers into “core methods” (the ones we probably can’t do without) and “optional methods” (the ones we could implement with the core methods if we wanted to).
We’ll use the AAA approach (which used to be the LIA approach and may get renamed again).
* * *
One of the skills I hope you’ll develop in the course is the ability to design new things (most often, ADTs and data structures). Hence, in addition to labs, we’ll spend a reasonable amount of class time on design problems. You had a lot of time to think about stacks. You’ll have less time for this.
I’ll ask you to take a full minute to think to yourself before you pair and then share.
I want things that I can use like arrays, but I don’t want to have to specify their capacity in advance. They should always be big enough for how I’m using them.
I’d also prefer not to have a different syntax for arrays than for the structures I build myself.
If we’re lucky, we’ll have the time to talk through some of these.
Probably not this one.