Home CPSC 340

Introduction to Data Structures


Data Structures

A data structure is a scheme for storing data in an organized way that allows the data to be used efficiently.

So far most of you have probably used one data structure for most things: the array (or ArrayList). Arrays are good for many tasks, but there are some things arrays are quite poor at.

In this class, we will learn data structures that solve a variety of problems, such as:

You could use arrays for solving these problems, but using the best data structure for the job will do two things:

  1. They will make your programs more efficient (sometimes by a lot).
  2. They will make your programs simpler and more natural to write.



An algorithm is a step-by-step procedure for solving some problem, or accomplishing some task.

There are several basic operations that are supported by most data structures:

Each of the data structures we look at will have a different algorithm for accomplishing each of these tasks. So we will learn many different algorithms in this class. Some of these are simple and some are more complex.

We will also learn many algorithms that operate on the different data structures we use, as examples of when the data structure will come in handy.

And finally, we will talk about algorithms independent of any data structures. It turns out that most algorithms can be categorized into one of several categories based on the ways they work. Learning to recognize which type of algorithm can be used to solve various problems is very helpful as a programmer.


Algorithm Analysis

Another important aspect of this course is algorithm analysis which is the study of how efficient an algorithm is. Whenever we come up with algorithms in this class, we will analyze them to see how efficient they are. You might think that this will involve running programs, but algorithm analysis is actually done without actually needing to run a program, or even code it.

Algorithm analysis will let us talk about and compare algorithms without needing to get down to specifics, like what language we are using or what type of computer we are running it on. Being able to determine the efficiency of an algorithm is important in choosing what data structures and algorithms are best for a particular task.


The Importance of Data Structures

Knowing and being able to use data structures effectively is the biggest thing that sets really good programmers apart.

The goal of this course is to give you the knowledge of how various data structures work, what problems they are good at solving, and the ability to use them in programs.

Copyright © 2024 Ian Finlayson | Licensed under a Attribution-NonCommercial 4.0 International License.