Princeton University COS 226 intermediate

COS 226: Data Structures and Algorithms

Free study notes for COS 226 (COS226) — Data Structures and Algorithms at Princeton University, one topic at a time, each with worked examples and a practice quiz.

63 students saved this course 633 views 6 notes

Course Syllabus

  1. Introduction to DSA & Analysis of Algorithms
  2. Linear Data Structures: Arrays, Linked Lists & Stacks/Queues
  3. Trees & Heaps
  4. Hashing & Graphs
  5. Sorting & Searching Algorithms
  6. Advanced Algorithms & Problem Solving Techniques

Study Notes

Introduction to DSA & Analysis of Algorithms

Data Structures and Algorithms are the bedrock of computer science.
A Data Structure is a specialized format for organizing and storing data. Think of it as a container designed for specific kinds of operations to be efficient. Examples include arrays, linked lists, trees, and hash tables.
An Algorithm is a step-by-step procedure or a set of rules used to solve a computational problem. It's like a recipe for a computer. Examples include sorting algorithms (like bubble sort, quicksort) or searching algorithms (like binary search).

Read full note →

Linear Data Structures: Arrays, Linked Lists & Stacks/Queues

Linear data structures are fundamental ways to organize data where elements are arranged sequentially, meaning each element has a predecessor and a successor (except for the first and last). This section covers three common types: Arrays, Linked Lists, and Stacks/Queues.

An array is a collection of elements of the same data type stored in contiguous memory locations. This means all elements are right next to each other in RAM. Each element has an index, usually starting from 0, which allows for direct and fast access.

Read full note →

COS 226: common questions

What does COS 226 cover?

This COS 226 study guide covers 6 topics: Introduction to DSA & Analysis of Algorithms, Linear Data Structures: Arrays, Linked Lists & Stacks/Queues, Trees & Heaps, Hashing & Graphs, Sorting & Searching Algorithms, Advanced Algorithms & Problem Solving Techniques.

Are these COS 226 notes free?

Yes. Every COS 226 note on this page is free to read without an account. A free account adds practice quizzes, flashcards and a revision plan.

How do I revise for my COS 226 exam?

Read the COS 226 note for each topic, then take its practice quiz: the questions you get wrong come back as flashcards until you know them. Save the course to get a revision plan built around your exam date.