Skip to content

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.

Notifications You must be signed in to change notification settings

egbonjefri/java_programming_robert_wayne

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Computer Science Programming with Java

Overview

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.

Contents

The repository is organized according to the book's structure, with four main sections:

1. Elements of Programming

  • 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, and for.
  • 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.

2. Functions and Modules

  • 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.

3. Object-Oriented Programming

  • 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.

4. Algorithms and Data Structures

  • 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.

Key Topics

  • 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.

Case Studies

The repository includes solutions to several in-depth case studies:

  • Random Web Surfer
  • Percolation
  • N-Body Simulation
  • Small-World Phenomenon

How to Run

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

Prerequisites

  • Java Development Kit (JDK)
  • Basic understanding of Java programming

Acknowledgements

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.

Note

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.

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages