CSS 343: Notes from Lecture 1 (DRAFT)

Administrivia

Introduction

Why Study Data Structures & Algorithms?

  1. the difference between the technician and the engineer is that the engineer understands the library calls being made and can make competent decisions about various tradeoffs involved
  2. data structures and algorithms is about perfecting the craft of programming
  3. demonstrating deep understanding of data structures is a critical job interview skill

Arguably, Data Structures & Algorithms is the single most important course in the software engineering programme.

Goals

Non-Goals

There are numerous important topics that are beyond the scope of this course.

In passing, we may discuss tactical software-engineering concepts such as:

What is Software?

Your humble instructor distinguishes between (computer) programs, i.e. the instructions that drive hardware and software which includes the program(s) plus other artifacts. Software:

This has implications on how we design and construct software.

This course is about the programming, but it is important to keep in mind that software is about more than just the programs.

CSS 342 Review

Complexity Theory (Performance)

Example:

Note that a particular program (algorithm) has a running time calculated using big-oh notation, but an algorithmic problem may have a lower bound. For example, we say that sorting is an O(N log N), but bubble sort (a particular implementation of a sorting algorithm) runs in O(N2) time.

Post-lecture addendum: demonstration of Fibonacci function (an O(N) problem) coded as an O(2N) function using naive recursion and an O(N) function using a tail recursion technique

Complexity (Cognitive Load)

Abstraction

Abstraction is such an important concept that we use multiple terms that mean essentially the same thing:

It's important to note that information hiding is not a security feature:

There are two parts to an abstraction:

Example: if you built a robot, you would have to code individual "muscle" contractions. From those individual movements, you might code more complex action, such as "flip the light switch". Ultimately, movement boils down to those individual muscle contractions, but we don't think in those terms.

Abstraction layers:

The key to programming (systems design) is finding good abstractions.

What makes a good abstraction:

Modeling

Modeling: keep essence; discard nonessential details.

Example: the Earth is flat. If you are building a house, you do not need to take the curvature of the planet into account.

What is essential depends highly on the application.

Example: modeling of an an airplane: