A Comprehensive Guide to

Data Structures

& Algorithms

Produced by the Phillips Academy CSC630 Class

Start Here

Examples in Java and Python


linkedList.java

class Node {
 int data;
 Node next;

 Node(int data) {
  this.data = data;
 }
}

linkedList.py

# Function to initialize the linked list object
class LinkedListNode(object):
 def __init__(self, data):
  self.data = data # Assign data
  self.next = None # Initialize

Various Learning Styles

Readings

Quick Sort

Quicksort works by partitioning an array based on an arbitrary element in the array, which we will refer to as p. The array is divided into two subarrays, one which contains elements larger than p, and one which contains elements smaller than p. The operation is then repeated with each of the subarrays, with a new p for each subarray, until the array is separated into sub-arrays with a designated length, usually 1. p is also known as the pivot.

Videos

Practice Exercises

When would QuickSort take O(n2) time to sort?
Why do we use decision trees to model binary search?
Do queues handle multiple data types?

Ready to Learn?

Start Here

PA DSA

Introduction to Data Structures and Algorithms
  • Thomas H. Cormen
  • Charles E. Leiserson
  • Ronald L. Rivest
  • Clifford Stein
Copyright CSC630 - 2022©

MIT License

Notice

PA DSA is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content.

Contact

csc630@gmail.com