Introduction 1 | Why Study Data Structures and Algorithms
By Professor Gerry Jenkins
Summary
Topics Covered
- Algorithms Predate Computers By Over Two Millennia
- An Automobile Is Levels and Levels of Abstraction
- Computer Science Is Not the Study of Programming
- What Computer Science Actually Studies
- Programming as a Creative Craft
Full Transcript
okay this is the uh first uh video of the lecture for chapter one and we're going to cover the ideas of computer science abstraction and the abstract
data type and there's quite a bit there although in the next series of lectures we'll be covering the Python programming language which will take us a couple weeks to cover so first about computer science uh
because computers have become more and more complex and we're solving larger and larger problems uh and actually more difficult problems uh computer science
is becoming more and more important uh to solve problems in fact you'll see problem solving computers is is now integrated almost every level of Science and becoming more and more important
actually making advances in science these days uh now computer science the science part is to have a way that we can create repeatable Foundation and principles to be able to apply those
principles to problems now you have already learned how to develop a prop a program given a problem statement uh so in intro class we give you a lot of here's a here's
something to write a program that does this and you write a program that does that and so basically you've taken a problem statement and you've been able to write a program now when you get into
larger programs you have to start to develop more of a systematic way of doing that so in larger programs there's a whole sign of how do you break down the problem statement and identify what
parts of that apply to the program um and we're not really going to get into that that's more of an advanced software engineering problem and you also learn some of that in the it area of how do you solve problem solving now you also
learned that programming can be quite hard and involve a lot of complexity and there just a lot of detail and knowing the syntax and the rules of a language that you have to learn now you've
already been through that once for a language it turns out a lot of those things you've learned you can apply to a new language and that's what we're going to do and as you learn more and more new
languages uh you're you're not really afraid of learning some new language anymore uh because you've got a good solid foundation for jumping into any new language but there are some
fundamental ideas that can be related to both the problem solving process uh that can be used to help so during this class by looking at how certain problems have
been solved and and worked on by a lot of computer scientists you'll start to build some foundational ideas you can apply to problems that you didn't have before so uh two important things in this chapter is a review of computer
science and the study of algorithms which we're doing in this slideshow and how data structures fit into that and then we're also going to spend a lot of time on learning the P the uh Python
programming language and we're not going to learn the whole language uh but we are going to learn a bit more than what's in the book uh we're going to give you some extra material on object-oriented programming and a little
bit on functional programming now algorithms uh which are basically developing a stepbystep listm instructions to solve a problem which so
this is kind of the scientific approach to problem solving uh has been around for a really long time in fact the first algorithms are dated back to 300 BC and the thing about an algorithm is once you
have a step-by-step way of following uh uh some instructions to solve a problem you can teach people to do that so with the Advent of writing uh this is important to write down how
to solve certain problems and so uh this became the first algorithms now of course computers came along a lot later uh so the we primarily still look at how
do you do algorithms but it's within the context of eventually realizing it on a computer but basically in computer science you're studying algorithms now the study of solutions to
problems as well as the study the problems with no solution turns out to be part of computer science we're not really going to look at the problems with no no Solutions in this class and that's the problem of whether
something is computable or not computable everything we're going to be doing in this class is a computable problem we might mention as we go some problems that are not realistically
computable but there are actually some problems that can be proved that there can never be a solution to them uh now CS is also the study of
abstraction so we're going we're going to see that a lot of what you do in programming is abstraction so that rather than writing the specific steps for a computer to do something you're
going to rely more on more on people that have written those steps for you and they've abstracted their work so you can use it easily with just a simple interface so in abstraction let's talk
about controlling an object uh we're going to see there's two types of main abstraction uh in a bit and in object programming this is kind of how you approach object ordered programming you
you'll deal everything as an object and you have certain control over that object and we're interested in the perspective of how you control that object so they use the example here of an
automobile now when you're a driver you have to learn the controls for an automobile and there's not that many of them and uh once you learn those simple
set of controls uh you can you can control the automobile now the automobile is very very complex mechanical device if you become a
mechanic you would learn a certain level of that device but even then you get into the computer systems inside some of the subm modules and you'd have to go to the fact that makes those to understand
what they do so actually an automobile is levels and levels of abstraction uh meaning that you as the automobile driver only have to know a certain number of controls and that's an
abstraction because you can control the entire car with just those controls you use those controls it does what you want and that's it you get into any other manufacturers cars they have the same
set of controls and that's also important where you duplicate the same set of controls across all cars so there's a lot of these controls are standardized and that's going to be similar to what we're going to talk
about with abstract data types so we call the set of controls to control something like this your interface so an interface is just basically a list of
the controls probably what they do so here's an example of an interface that's part of python and this is similar to what in Java or C++ you had
functions you could def you could call a function to give you the square root uh so here in Python you can call a function to give the square root of 16 and it prints out the result so
somewhere someone has written dysfunction which has computer code inside of it we don't know what language doesn't matter we don't know how it actually computes the square root we don't really care we just want to know
that it works for us so that it's an abstraction that works all the time and we can rely on it so you can think of the square root
function as a black box and you call it with n and it Returns the square root of n now in your intro class you actually wrote functions or methods that you pass parameters and it did something so you
actually wrote all the code but once you had that function defined you could add it to a library and other people could use it as long as it worked correctly they wouldn't have
to know what code you put inside as long as it wasn't too slow or it didn't use all the memory or it didn't it it it worked in all the numbers they expected as long as it met the expectations then
they could use it so so that whole issue of of boxing your code inside of this just this name thing is is called a procedural abstraction and procedural abstraction is primarily what uh your
previous class was about when you studied functions and methods so what is programming well programming is the process of taking an algorithm and encoding it into a
notation which is a programming language so that it can be executed by the computer computer science is actually not the study of programming uh sometime there is a whole
area of computer science which studies programming languages but we're what not really the study of action ual programming it's the process of developing
algorithms so that's going to be what's important so programming is an important part of computer science we're not saying that you yeah you're not going to be programming or you don't need to know about programming but it's not the end
all it's like if you're a writer it's important that you can you you know English and you can put sentences together and you do that all the time in writing and other and different writers
write in different languages but but uh writing is not about that part so programming is how we Implement a working representation of our algorithm and it's actually uh
programming is much more creative just like writing is creative programming is creative
Loading video analysis...