Courses
  • IITGN
  • Online
  • Short Courses
  • Other

ES 242 | Aug-Nov 2022

ES242. Data Structures and Algorithms I.

August — November 2022
About the Course

Data structures give us principled ways to stow away information. It’s important to do this nicely based on what you want to do with the information.

For example, the notes you might be taking in this class is information. If you have no plans of revisiting them later, you can take them as you please, or better yet, not take them at all!

However, you want your notes optimised for giving you quality company during a 2AM revision session on exam day, competing with Maggi for attention, you want your notes to be competently taken: they don’t have to be neat, and it’s enough for them to be useful.

On the other hand, if you are taking notes so that a special someone who will inevitably miss a few classes will almost certainly ask for later, then you would be making notes to impress, and that potentially requires a different approach.

Throughout this course, we will try to make sense of trade-offs.

Topics

sequential data (arrays, dynamic arrays, linked lists and variants) • dequeues, stacks, queues • graph representations • graph traversals (BFS/DFS) and applications (connected components, bipartiteness, topological sort) • searching and sorting • heaps • BSTs • (2,3)-trees

Target Audience

This course is aimed at undergraduates in their first or second year, as a first introduction to data structures and algorithms.

Prerequisites

The course is largely self-contained. Working familiarity with a programming language will be useful for the labs, where solutions are expected to be written out in C.

References
  1. Open Data Structures by Pat Morin
  2. Lecture notes by John Bullinaria
  3. Data Structures Using C & C++ by Aaron M. Tenebaum; Moshe J. Augenstein; Yedidyah Lansam
  4. Data Structures and Algorithms by A. Aho, J. Hopcroft, J. Ullman
  5. Algorithms by Jeff Erickson
Timings and Venue

Lectures on Tuesdays and Wednesdays • 10AM — 11AM • 1/101 Labs on Wednesdays • 4PM — 6PM • 7/108 and 7/109

TAs and Office hours
Office Hours

By appointment.

Theory:
  1. Harshil Mittal (mittal_harshil@iitgn.ac.in)
  2. Saraswati Nanoti (nanoti_saraswati@iitgn.ac.in)
Labs:
  1. Ksheer Agrawal (ksheer.agrawal@iitgn.ac.in)
  2. Progyan Das (progyan.das@iitgn.ac.in)
  3. Nipun Mahajan (mahajan.n@iitgn.ac.in)
  4. Yash More (yash.mh@iitgn.ac.in)
ADH Mentors:
  1. Xhitij Choudhary (xhitij.cm@iitgn.ac.in)
  2. Bhavesh Jain (bhavesh.jain@iitgn.ac.in)
Evaluation policy
  • Weekly Assignments on Google Classroom. 2 * [top 10] = 20

  • Lab Assignments on repl.it. 1 * [top 10] = 10

  • Class participation via Mentimeter. 0.5 points per class capped at 10

  • Midsem Exam. 10 (lab) + 10 (theory) = 20

  • Final Exam. 10 (lab) + 15 (theory) = 25

  • Four quizzes (two theory, two lab & top 3 outcomes counted). 3 * 5 = 15

Registration

For IITGN students, (pre-)register through IMS as usual.

If you are not from IITGN and are interested in taking up the course, then please send me an email.

Registration for the course is now closed. The next edition of this course will be offered in the Jan - Apr 2023 semester.

Note: contents being actively updated at the time of this writing. Enroled students will find all materials in the Google classroom for this course. Items marked {{< bi alarm color="indianred" >}} are coming soon!

  • Lectures
  • Labs
  • Mentimeter
  • Assignments
  • Quizzes
  • Exams
Date Lecture Slides Notes Video
02 Aug, 2022 1. Introduction to Data Structures
Data Structures - philosophy and examples • Representing games
03 Aug, 2022 2. Introduction to Data Structures
Representing Sequential Data • Arrays • Lists
09 Aug, 2022 Institute Holiday
10 Aug, 2022 Quiz 0 (Ungraded)
16 Aug, 2022 3. Representing Graphs
Adjacency Lists • Adjacency Matrices • Edge Lists
17 Aug, 2022 4. Representing Graphs (contd.)
Adjacency Lists • Adjacency Matrices • Edge Lists
23 Aug, 2022 5. Dequeues
Introducing the cardstack data structure • The Gilbreath Shuffle
24 Aug, 2022 6. Dequeues
Queues and Stacks as special cases of Dequeues
30 Aug, 2022 7. Euler Tours
Euler Tour Demonstration • Card trick • de Bruijn sequences • Constructing de Bruijn sequences using Euler Tours
31 Aug, 2022 8. Euler Tours
Computing Euler Tours • Hierholzer's algorithm
06 Sep, 2022 9. Stable Marriages
The Stable Marriage Problem • Gale-Shapley Algorithm
07 Sep, 2022 10. Stable Marriages
Proof of Termination • Bounding the number of proposals • Proving the stability of the output
13 Sep, 2022 11. Recap Lecture
Review of arrays, linked lists, stacks, queues, and graphs
14 Sep, 2022 Theory Quiz 01
20 Sep, 2022 12. Navigating Graphs
An introduction to navigating graphs
21 Sep, 2022 13. Navigating Graphs (BFS)
Breadth-First Search • Correctness • Analysis of Running Time
11 Oct, 2022 14. Navigating Graphs (DFS)
Depth-First Search • Pre-Post Intervals
12 Oct, 2022 15. Navigating Graphs (DFS)
Depth-First Search • DFS-based classification of vertices • DFS-based classificaton of edges • Cycles and backedges
18 Oct, 2022 16. DFS Applications
Topological Sort (Algorithm)
19 Oct, 2022 17. DFS Applications
Postorder • Preorder • Topological Sort (Analysis)
25 Oct, 2022 18. Shortest Paths
A teaser the challenges in extending BFS to weighted graphs • Pseudopolynomial running time
26 Oct, 2022 19. Heaps
Selection Sort • Supporting only Insert and FindMin • The challenge of ExtractMin
01 Nov, 2022 20. Heaps
The Heap Property • Insert • FindMin • ExtractMin
02 Nov, 2022 21. Heaps
Representing Heaps with Arrays
08 Nov, 2022 Institute Holiday
09 Nov, 2022 Theory Quiz 02
15 Nov, 2022 22. Heaps Revisited
Analysis • Heapify is Linear Time
16 Nov, 2022 23. Balanced Binary Search Trees
(2,3)-Trees • Insertion • Deletion
22 Nov, 2022 24. Balanced Binary Search Trees
(2,3)-Trees Height Analysis
23 Nov, 2022 25. Recap
Review of BFS, DFS, Heaps, and Balanced BSTs
No matching items
Issued Assessment Problems Solutions Due
03 Aug, 2022 W01. Representations

Finding the Coefficient
Finding the Coefficient Redux
Game of Trust
Game of Trust [Open Ended]
Validating a Self-Working Card Trick [Open Ended]

10 Aug, 2022 W02. C Warmup and Recap

Four Points
Waking Up
Ratings
Meta Tic-Tac-Toe [Open Ended]

17 Aug, 2022 W03. Representing Graphs

Swapping Variables
Adjacency Matrix
Edge List
Adjacency List
Getting Even

24 Aug, 2022 W04. The Cardstack

Print alternate cards
Reverse a list of numbers
Cut shuffle
Overhand Shuffle
de Bruijn sequences

31 Aug, 2022 W05. Euler Tours and de Bruijn Sequences

Euler Circuit Sanity Check
Highway Orientation
Edge Orientation Puzzle
Generate de Bruin Sequences

07 Sep, 2022 W06. Stable Marriages

Merge List
Insert Node
Reverse The List
Count Blocking Pairs
Stable Matchings

14 Sep, 2022 No Lab

Lab Quiz 1 (held on 17 Sep, 2022)

21 Sep, 2022 W08. Navigating Graphs (BFS)

Find My Ancestor!
Longest Path
Unique Servers
Run a Marathon
Just BFS

12 Oct, 2022 W09. Practice Lab

Cop and Robber
Balanced Brackets
Whispering Joker
Time Series
String Game
Lab Exam (held on 15 Oct, 2022)

19 Oct, 2022 W10. Navigating Graphs (DFS)

2-Colorable Graphs
Topological Sort
Is DAG?
Get Food!

26 Oct, 2022 W11. Graph Traversal Applications

Learning Languages
Permutation Tree
Make Walls
Palindromic Crosswords

02 Nov, 2022 W12. Heaps

Heapify
HeapSort
The Unity Project
Largest Number

09 Nov, 2022 W13. Practice Lab

Visit Me First
Visit Me Last!
Sort a Tree
Predicting Possibility
Can You Register?

16 Nov, 2022 No Lab

Lab Quiz 2 (held on 20 Nov, 2022)

23 Nov, 2022 W15. Recap Lab

Review of Problems
On Writing Tests
Benchmarking

No matching items
Heads Up

These questions are integrated into the lectures and may not make sense standalone. Please check the slides and/or notes for additional context.

Issued Assessment Problems Solutions Due
02 Aug, 2022 Introduction to Data Structures

Data Structures - philosophy and examples • Representing games

03 Aug, 2022 Introduction to Data Structures

Representing Sequential Data • Arrays • Lists

16 Aug, 2022 Representing Graphs

Adjacency Lists • Adjacency Matrices • Edge Lists

17 Aug, 2022 Representing Graphs (contd.)

Adjacency Lists • Adjacency Matrices • Edge Lists

23 Aug, 2022 Dequeues

Introducing the cardstack data structure • The Gilbreath Shuffle

24 Aug, 2022 Dequeues

Queues and Stacks as special cases of Dequeues

30 Aug, 2022 Euler Tours

Euler Tour Demonstration • Card trick • de Bruijn sequences • Constructing de Bruijn sequences using Euler Tours

31 Aug, 2022 Euler Tours

Computing Euler Tours • Hierholzer's algorithm

06 Sep, 2022 Stable Marriages

The Stable Marriage Problem • Gale-Shapley Algorithm

07 Sep, 2022 Stable Marriages

Proof of Termination • Bounding the number of proposals • Proving the stability of the output

13 Sep, 2022 Recap Lecture

Review of arrays, linked lists, stacks, queues, and graphs

20 Sep, 2022 Navigating Graphs

An introduction to navigating graphs

21 Sep, 2022 Navigating Graphs (BFS)

Breadth-First Search • Correctness • Analysis of Running Time

11 Oct, 2022 Navigating Graphs (DFS)

Depth-First Search • Pre-Post Intervals

12 Oct, 2022 Navigating Graphs (DFS)

Depth-First Search • DFS-based classification of vertices • DFS-based classificaton of edges • Cycles and backedges

18 Oct, 2022 DFS Applications

Topological Sort (Algorithm)

19 Oct, 2022 DFS Applications

Postorder • Preorder • Topological Sort (Analysis)

25 Oct, 2022 Shortest Paths

A teaser the challenges in extending BFS to weighted graphs • Pseudopolynomial running time

26 Oct, 2022 Heaps

Selection Sort • Supporting only Insert and FindMin • The challenge of ExtractMin

01 Nov, 2022 Heaps

The Heap Property • Insert • FindMin • ExtractMin

02 Nov, 2022 Heaps

Representing Heaps with Arrays

15 Nov, 2022 Heaps Revisited

Analysis • Heapify is Linear Time

16 Nov, 2022 Balanced Binary Search Trees

(2,3)-Trees • Insertion • Deletion

22 Nov, 2022 Balanced Binary Search Trees

(2,3)-Trees Height Analysis

23 Nov, 2022 Recap

Review of BFS, DFS, Heaps, and Balanced BSTs

No matching items
Issued Assessment Problems Solutions Due
No matching items
Issued Assessment Problems Solutions Due
10 Aug, 2022 Quiz 0

10 Aug, 2022 Quiz 1

10 Aug, 2022 Quiz 2

20 Nov, 2022 Lab Quiz 2

No matching items
Issued Assessment Problems Solutions Due
28 Sep, 2022 MidSem Exam

30 Nov, 2022 EndSem Exam

No matching items

Made with Quarto and 🩶

 

Content by Neeldhara Misra