Lecture

Backtracking Pseudocode

This module introduces backtracking pseudocode through practical examples, covering:

  • Sudoku solver implementation
  • Cryptarithmetic problems
  • Introduction to pointers and single pointer operations

Students will learn how to apply backtracking techniques to solve complex problems.


Course Lectures
  • This module introduces the overall structure and philosophy of the Introduction to Computer Science series at Stanford. Key aspects include:

    • The philosophy behind CS106B
    • Reasons to take the course
    • Logistical details for successful course engagement
    • Basic introduction to C++ and its significance
  • This module focuses on the similarities between C++ and Java, covering essential programming concepts such as:

    • Syntax
    • Variable types
    • Operators
    • Control structures

    Examples of C++ code, including function definitions and loops, are explored to provide a clear understanding of programming principles.

  • This module delves into C++ libraries, particularly the standard libraries and CS106-specific libraries. Topics include:

    • CS106 random.h library
    • C++ string type and its operations
    • Member functions of string class
    • Differences between C++ strings and Java strings
    • C++ console I/O operations

    Live coding examples demonstrate working with strings and file I/O.

  • C++ Console I/O
    Julie Zelenski

    This module continues the exploration of C++ console and file input/output operations, focusing on:

    • Stream operations
    • Live coding examples for file handling
    • Passing file streams by reference
    • Error handling functions
    • Class libraries and object-oriented features

    Students will gain hands-on experience through live coding sessions.

  • Client Use of Templates
    Julie Zelenski

    This module covers the concept of templates in C++, specifically focusing on:

    • Client use of templates
    • Vector class and its client interface
    • Type safety in templates
    • Grid and Stack classes
    • Learning new API documentation

    Live coding examples demonstrate the practical application of these concepts.

  • More Containers
    Julie Zelenski

    This module focuses on additional containers in C++, including:

    • Map class and its uses
    • Set class and its unique operations
    • Iterating over maps and sets
    • Live coding examples demonstrating container functionality

    Students will learn about the versatility and differences of these data structures.

  • This module discusses the concept of treating functions as data in C++. Key topics include:

    • Specific plot functions
    • Generic plot function implementation
    • Using sets with user-defined data types
    • Client callback functions
    • Live coding examples illustrating recursion and recursive decomposition

    Students will understand how to utilize functions as first-class citizens in programming.

  • This module addresses common mistakes encountered in programming with C++, focusing on:

    • Concatenating strings
    • Recursion pitfalls
    • Examples of recursion like calculating power
    • Efficient recursion techniques
    • Detailed walkthroughs for examples like palindromes and binary search

    Live coding sessions will help clarify these concepts and improve programming skills.

  • Thinking Recursively
    Julie Zelenski

    This module emphasizes recursive thinking and its applications in programming. Topics include:

    • Procedural vs functional recursion
    • Fractal programming examples
    • Classic recursion examples like Tower of Hanoi
    • Live demos showcasing the tree of recursive calls

    Students will develop a deeper understanding of recursive problem-solving techniques.

  • Refresh: Permute Code
    Julie Zelenski

    This module revisits permutation code and further explores the tree of recursive calls. Key points include:

    • Testing with different cases
    • Eliminating duplicates in permutations
    • Subset strategies and their implementations
    • Understanding exhaustive recursion and backtracking
    • Examples like the N-Queens problem

    Live coding examples will enhance understanding of these concepts.

  • Backtracking Pseudocode
    Julie Zelenski

    This module introduces backtracking pseudocode through practical examples, covering:

    • Sudoku solver implementation
    • Cryptarithmetic problems
    • Introduction to pointers and single pointer operations

    Students will learn how to apply backtracking techniques to solve complex problems.

  • Pointer Movie
    Julie Zelenski

    This module focuses on pointers in C++, including:

    • Pointer operations and memory diagrams
    • Using pointers with dynamic arrays
    • Recursive data structures and their implementations
    • Live demonstrations with linked lists

    Students will gain hands-on experience with pointers and their significance in programming.

  • Coding with Linked List
    Julie Zelenski

    This module covers linked lists in depth, focusing on:

    • Printing linked lists recursively
    • Memory deallocation techniques
    • Implementing prepend and insert functions
    • Comparing arrays and linked lists

    Live coding examples will enhance understanding of linked list operations and efficiency.

  • Selection Sort
    Julie Zelenski

    This module introduces sorting algorithms, including:

    • Selection sort and its analysis
    • Insertion sort and its comparison to selection sort
    • Merge sort, including its working and analysis
    • Quick sort and strategies to avoid worst-case scenarios

    Live demos will illustrate the execution and performance of these algorithms.

  • This module explores the partitioning process for quicksort, addressing:

    • Implementation of quicksort code
    • Live demonstrations comparing quicksort and merge sort
    • Worst-case scenarios in quicksort
    • Generic functions and templates

    Students will understand the intricacies of the quicksort algorithm and its applications.

  • This module discusses sort templates with callbacks, emphasizing:

    • Supplying callback functions in templates
    • Object-oriented programming principles
    • Class division and interface design in C++
    • Implementing constructors and destructors for classes

    Students will learn how to design effective class structures in C++.

  • Abstract Data Types
    Julie Zelenski

    This module focuses on abstract data types (ADTs) in C++, covering:

    • The significance of ADTs and their applications
    • Live coding examples of creating vector classes
    • Dynamically growing data structures
    • Templatizing classes for versatility

    Students will understand how to implement and utilize ADTs effectively.

  • This module outlines rules for template implementation in C++, including:

    • Consequences of memory allocation
    • Implementing stack classes and member functions
    • Midterm post mortem reflections

    Students will learn best practices for effective template programming.

  • This module provides a recap of stack implementations, focusing on:

    • Vector-based stack implementation
    • Linked list implementation for stacks
    • Push/pop function analysis
    • Queue implementation and variations
    • Case study of a text editor using stack structures

    Live coding sessions will illustrate the practical applications of these concepts.

  • Buffer: Vector vs Stack
    Julie Zelenski

    This module compares buffer implementations using vector and stack structures. Key topics include:

    • Buffer as a linked list and cursor design
    • Movement and insertion/deletion in linked lists
    • Performance implications of different strategies
    • Implementing map structures using various strategies

    Students will gain insights into buffer management and data structure performance.

  • Map as Vector
    Julie Zelenski

    This module discusses the implementation of maps in C++, focusing on:

    • Binary search trees (BST) and their operations
    • Tree traversals and their applications
    • Implementing maps using trees and evaluating their performance
    • Handling unbalanced trees and maintaining efficiency

    Live coding examples will enhance understanding of tree data structures.

  • Pathfinder Demo
    Julie Zelenski

    This module provides a comprehensive overview of graphs in C++, including:

    • Graph representation techniques
    • Traversal algorithms: Depth First Search (DFS) and Breadth First Search (BFS)
    • Graph search algorithms and weighted arcs
    • Implementation strategies for effective graph handling

    Students will gain practical experience through live coding sessions focused on graph algorithms.

  • This module compares different map implementations, covering:

    • Hashtable concepts and hash functions
    • Handling hash collisions and performance evaluation
    • Real-world examples of hashing techniques
    • Implementing set structures through hashing

    Live coding examples will demonstrate the practical applications of hash tables.

  • Lexicon Case Study
    Julie Zelenski

    This module presents a case study on lexicons, examining:

    • Lexicon as a sorted vector, BST, and hash table
    • Dynamic arrays for children management
    • Trie implementation for prefix handling
    • Directed Acyclic Word Graph (DAWG) structure

    Students will explore patterns in word management and the final results of the DAWG implementation.

  • Final Showdown
    Julie Zelenski

    This final module encourages students to reflect on design choices made throughout the course, covering:

    • Runtime performance and memory usage
    • Code complexity and trade-offs
    • Comparative analysis of different data structures
    • Key takeaways and future learning considerations

    Students will solidify their understanding of programming principles and best practices.

  • This guest lecture provides insights into the C++ language, including:

    • A quick history of C++ and its development
    • The philosophy behind C++ programming
    • Common headers and their functionalities
    • Standard Template Library (STL) and language features

    Students will gain a broader understanding of C++ and its applications in modern programming.