This repository contains my solutions to the programming challenges from the book "Computer Science: An Interdisciplinary Approach" by Robert Sedgewick and Kevin Wayne. The challenges cover a wide range of topics in computer science, focusing on Java programming.
The repository is organized according to the book's structure, with four main sections:
- Your First Program: Basic introduction to writing and running your first Java program.
- Built-in Types of Data: Manipulating strings, integers, and other primitive types.
- Conditionals and Loops: Exploring control flow structures including
if
,while
, andfor
. - Arrays: Understanding array structures and implementing basic operations.
- Input and Output: Reading from and writing to standard input and output.
- Case Study: Random Web Surfer: Simulating a web surfer using random walks and Markov chains.
- Defining Functions: Writing reusable functions and understanding function scope.
- Libraries and Clients: Using external libraries and building client programs.
- Recursion: Solving problems recursively, including classic examples like the Towers of Hanoi and Euclid's algorithm.
- Case Study: Percolation: Implementing percolation detection and simulation.
- Using Data Types: Working with existing data types and understanding encapsulation.
- Creating Data Types: Designing custom data types with constructors and methods.
- Designing Data Types: Understanding inheritance, polymorphism, and encapsulation in class design.
- Case Study: N-Body Simulation: Simulating gravitational interactions between celestial bodies.
- Performance: Analyzing algorithmic performance and applying Big-O notation.
- Sorting and Searching: Implementing efficient algorithms for sorting and searching data.
- Stacks and Queues: Utilizing stack and queue data structures in various contexts.
- Symbol Tables: Implementing and using symbol tables, hash tables, and binary search trees.
- Case Study: Small-World Phenomenon: Exploring graph-based algorithms to model real-world networks.
- Basic Programming Constructs: Loops, conditionals, arrays, and input/output handling.
- Recursion and Algorithm Design: Recursive algorithms, dynamic programming, and divide-and-conquer strategies.
- Object-Oriented Design: Defining and designing data types with a focus on reusability and abstraction.
- Data Structures: Implementation of fundamental data structures like stacks, queues, and symbol tables.
- Graphs and Networks: Graph-based problem-solving including shortest paths and connected components.
The repository includes solutions to several in-depth case studies:
- Random Web Surfer
- Percolation
- N-Body Simulation
- Small-World Phenomenon
Each section contains Java programs that can be run from the command line. You can compile and execute the programs using the following commands:
javac ProgramName.java
java ProgramName
- Java Development Kit (JDK)
- Basic understanding of Java programming
All challenges and case studies are based on the book "Computer Science: An Interdisciplinary Approach" by Robert Sedgewick and Kevin Wayne. This repository contains my personal solutions and implementations of the concepts presented in the book.
This repository is for educational purposes and personal reference. If you're currently taking a course using this textbook, please adhere to your institution's academic integrity policies.