okay so we're going to try this out
I'm going to go ahead and start recording so I'm going to try
this captioning service and we'll see kind of how well it
works it should also show up in the video recording
so yeah does anyone have any questions from last week or
previously
before we get started here
it has anyone gone over the stacks and queues information
yet
ok
I guess I will just start talking about are stacks and
queues let me open up my graphics editor as well in case
you need that
we're going to work with both stacks and queues in the
exercises tonight and really these are really short like 10
minutes to implement
the main thing here is there's another paper based assignment
to introduce you two stacks and queues so data structures moving
forward any of these are I'm going to try to have a paper
assignment to go with it so you kind of get some idea of how
they work before we get into the code of what that actually looks
like
so in here there's the intro to stacks and queues and it just
kind of goes over the super basics and then the questions
are over what's it look like after a push and ask for a pop
or mixing the two and you'll also see these kinds of
questions in the quiz
so that is just get you used to how they work
there's also the written chapters on stacks and queues to
talk about how they work and also what they can be used for
and the project for this data structures application will use
stacks and queues and it's to build in this project to build
hamburgers but I tried to make it at least a little bit related
to how you might see it in like
computer software
when we open this up it's a starter code
there's not a whole lot of programming code that you'll
need to add into it but what we have is some input files
and he's just having gredients for the hamburger but there's an
opening and closing {for the start-and-stop of a burger the
Buns
but generally if you're doing this for like something computer
it could be a parsing a programming language it could be
doing math operations and using a stack in that way so this is
just kind of a introduction of how we can use a stack in a
program
and there's also going to be a q so basically will be loading in
text files in this project it will all the commands the input
commands will go into a q kind of lined up waiting to be
processed and then the stack will kind of keep track of one
set of data and wanted to text to the end of that data
basically the closing { will then say this is the end of this
section and we're going to kind of take everything off the stack
and then process it for the output file
I have some results in here so yeah I'll put will will not have
these in the output part but it'll output the assembled
Burgers so if this were like something that was doing a bunch
of math problems remember the order of operations you have (to
specify what gets operated on first we could use a stack to
say this is a parenthesis of a (inside) and it kind of helps us
order what order those go in
so it's really not a very complicated project but what you
will need for it are your data structures from the previous
exercise has so after you're done with your stack and queue
exercise has those will go in here
and you can choose to either use the smart Dynamic array or the
linked list
so you can choose I just put all of the a raisin the array q and
the link to the erase that can you link stack I put all of them
in there but you can choose to do just your IQ and the array
stack or just the linked q and The Links pack of it's up to you
but you need a Q and you need a sack and so in the starter code
I have the
basically empty versions of the linked list in the smart Dynamic
array you'll take your past version and add it in here and
then use your version of the smart Dynamic array and Orleans
list and the key when sick
and then the documentation is just in this file because we're
only really implementing to functions and looking through
how they work
and then for the exercises tonight
when you open these up
this will be in a saint the same sort of format but there's no
program written for the adjust the stack in the queue
themselves so when you run the stack or queue program
apparently I might be missing some files of
I might have to fix this
I should have all the files in
well I will look at that butt it should build and run I think I
need to fix some of the passing
but then you'll be able to run the stack tester and that will
tell you if your stack is working correctly or the Q if
it's working correctly so
just to go over this really quick
can Implement a queue and a stack on top of either the
linked list or the array we don't have to implement a whole
new Q and a whole new stack as data structure data structure so
basically a q if we build it on top of the list or a vector
The Q's push function is going to use the push back function of
the list or whatever the q's pop function is going to use pop
front and its peak or its view front of the list one is going
to use the get front function so when we're working with cues
we can have kind of a under a structure
or Lewis structure but we'll have a front
and a back
so when we add something to the queue it in terms of the back of
the line when we remove something from the queue it
leaves at the front of the line so you know if you were standing
in line at the store the person who's been sitting here the
longest to spend in the front of the Lion gets to go first in the
person who you know comes in and wants to get in line next they
have to wait their turn so that's just a simple Q so if
you're building on top of a list this would be pop front
and push back
with a stack it's a different type of structure where we can
only access things from the basically top of the stack we
think of it in terms of top and bottom
so it's still can be referenced as an array you just have to
decide which side of the array is the back and which which side
of the race of the bottom in which side of the ear is the top
but everything going into the stack or leaving the stack has
to go through the top so for this would be both push back
and pop back
so in these structures
which I
Riyadh
in the wrong spot
for instance the erase that contains a smart Dynamic array
within it and then basically whenever you hit the push
function for the stack you can stay in vector thought and then
it has its push back or insert back or whatever else
and you'll have to think of if you're treating the front of the
array
as the bottom and the top as the back you could also design at
the opposite way if you wanted to but you have to be consistent
so you could have the array be like this
did represent the stock
that will stay like for instance push back and then passed the
data on through so it's just kind of a way that it says we
have these these versions of the functions you're not able to do
anything else with the opposite side
but we just take the data pass it through to the underlying
structure in there
any questions about the stacking Cube and how those work
have the chapters up here that you can reference for more
information but those are the exercises for tonight I just
need to fix this part
so the Q folder has the array Q Link Q I have these in the wrong
order or something
okay give me a minute I'm apparently missing the stack one
of the stock files but I'll let you all get started on working
on the exercises if you're going to start with one of the code E1
start with the Q coding and then I'm going to go in and add the
missing file here and fix the project file
so just give me a moment on that