Introduction to Data Structures and Algorithm Analysis with Python

How this course works, what the workbench can do, and the chapter list.

This is a data structures and algorithm analysis course for the Swiftener Data Structures editor. You already know Python from Introduction to Python and the first algorithms from Introduction to Computer Science with Python. Here you study ADTs, Big-O, lists, hashes, trees, heaps, and graph algorithms with costs attached.

Language syntax belongs in Introduction to Python. First search/sort/BFS belongs in Introduction to Computer Science with Python. Modules and tests belong in Introduction to Software Engineering with Python. Library graphs belong in Learn NetworkX. This course stays on structures and analysis.

You do not install Python. Code and uploaded files stay in your browser.

Goal

Finish every chapter by running the copy-paste blocks in the workbench. The last chapter is kiosk logistics you can reuse.

How to take the course

  1. Keep this tutorial tab and the Data Structures workbench side by side.
  2. Wait until the workbench status says Python is ready.
  3. Copy an exercise, paste it as the whole editor, run it, then read the printed costs. Each shaded block is a complete script — it does not rely on leftover variables.
  4. When a chapter asks for a file, download it from the buttons above, then click Add files in the workbench.

The workbench Snippets menu is a cheat sheet. Prefer the exercises here — they are written for this editor.

What this editor can and cannot do

  • Can: standard library (heapq, collections), print, writes to /uploads, downloads.
  • Cannot: NumPy, matplotlib, git, or fetching URLs. Do not import numpy.
  • Always print(...) a result. Count operations when the chapter is about cost.
  • Python list and dict are the real implementations. When a chapter builds a linked list or a toy hash table, that is so the cost is visible.

Sample files

Download any of these from the banner, then attach them with Add files:

  • edges.csv — undirected Kenya roads with kilometres
  • unsorted.txt — numbers to sort
  • words.txt — city names with duplicates, for hashing
  • inventory.csv — product rows for practice

Chapter list

Work in order the first time. After that, jump around from the sidebar.