Algorithms
and
Data
Structures

Spring 2022
course
site
-->

getting started

hello

Welcome to the Spring 2022 Algorithms and Data Structures course.

Let's start by introducing ourselves.

Then I'll walk through the syllabus and explain what this course is all about.

What is an algorithm? A data structure? And why are we doing both at once? Good questions: I'll give a brief pep talk.

nuts and bolts

Rob Jenkins has a nice welcome to my classroom essay which is similar to what I expect from all of you : "In this classroom, we’re all adults. I promise to treat you like an adult, and you agree to behave like one."

Questions?

If you're not sure about anything, email me : jimmahoney@bennington.edu .

programming language(s)

Our primary language for describing and testing the algorithms and data structures I'll be discussing this semester will be Python. I use Python in my Intro CS courses; it's a powerful and popular general purpose multi-paradigm language

However, I'll also be doing some work in C, and inviting you to write code in that language too. C is a lower level language than Python, closer to the hardware and corresponding more directly with what computer chips actually do. Programs written in C are typically faster than those in Python, and it's a more accurate description of how that data structures that we'll be looking at actually work in computer memory.

You can pass this course without doing any C coding. However, you will gain a deeper understanding of the material by working in both languages.

Typically "Computer Systems" courses which look at operating systems and the inner workings of computers are done in a mixture of C and its corresponding assembly code. So if you're going to study CS as a degree field, it's worth learning C.

textbook(s)

There is no one textbook for this course. Instead, there are a number of online and offline (dead tree) books listed on the resources page. Please explore those and see which ones suit you.

I'll be assigning weekly study topics with some reading suggestions, often in several possible books. There are many, many sources for this material, and just googling by keyword or using wikipedia can be a reasonable starting point.

The simplest of the textbooks is Problem Solving with Algorithms and Data Structures using Python , (which I'll call "runestone pythonds" to save typing all that) written in Python, and covering many of the topics we'll study. It's main drawback is that it is in places somewhat simplistic and doesn't go far enough.

Skienna's hardcopy textbook is a common college choice; it's thorough and has many excellent explanations. It uses the C programming language. You may want to purchase a copy. His website also has extensive video lectures and slides, which I may use occasionally to introduce some the course topics.

software tools

Both Python and C can be run from a command line terminal on the jupyter.bennington cloud computer environment - so you can if you want do all the programming assignments in your browser.

Python can also be run at jupyter.bennington in a "jupyter notebook" setting, which is my choice for doing numeric plots and graphics, which we will use to analyze algorithms.

I'll do demos of all those systems, and it's what I'll usually be using for the live coding class examples.

All of these software tools are free and open source, and you can install them on your own laptop to work there if you would prefer.

math

We will be doing some math this term: some logs, a few limits, induction, counting and combinatorics, and perhaps even a proof here and there.

I'd be glad to explain any of that as we go along; please do ask questions if you don't understand anything, and we'll dig in deeper as needed.

first topics

Your first assignment is a brute-force search which I'd like you to implement in both Python and C, and time both for a variety of cases, collecting your results into text files.

I'm assigning this as both a diagnostic so that I can see where you are, and as a warm-up so you can see some of the tools that we'll be using.

After that I'll continue with a bit of data structure lingo and concepts ("indexed array") and a couple classic algorithm examples (sorting and paren matching) to make explicit what the topics we'll be studying, and to give you more time to get your software tools and coding chops in gear.

And after that we'll head into "algorithm analysis", looking into how we should measure whether an algorithm is a good one or not, in part with what's called "big O" notation :

\[ O(1) \subset O(\log n) \subset O(n) \subset O( n^2 ) \subset O( 2^2 ) \subset O(n!) \]

And we'll be doing a number of numerical experiments and graphical plots in order to understand and illustrate what's going on.

what you should do to get going

getting help

show-and-tell

jupyter.benningt.college is running a jupyterhub cloud server, which provides

I'll do a demo, including

Here are example "hello world" programs in each of those three forms.

If time allows, I'll ask you to try that during class time and ask questions if anything isn't clear.

And if we still have time (and aren't too zoomed out), we'll go over some data types and syntax for Python and C.

https://cs.bennington.college /courses /spring2022 /algorithms /notes /feb17
last modified Thu February 17 2022 12:39 pm