This is a Java implementation of the famous "99 Problems" collection, originally written in Prolog and Lisp. The problems are designed to help developers learn programming concepts through practical exercises.
Each problem is implemented in its own dedicated class within the org.nintynine.problems package. The corresponding test class contains detailed test cases that demonstrate the expected behavior and usage.
For example:
- Problem P01: implemented as
last()inMyList.javawith tests inMyListP01Test.java - Problem P02:
MyListP02.javawith tests inMyListP02Test.javaAnd so on...
The test classes serve multiple purposes:
- Verification of the implementation
- Documentation through examples
- Edge case handling demonstration
Each test class follows a consistent pattern:
- Basic functionality tests
- Edge case tests
- Performance considerations where applicable
- Example usage scenarios
To run the tests:
bash ./mvnw test- Each class builds upon previous solutions where appropriate
- Test cases are designed to be self-documenting and comprehensive
- Java generics are used extensively to ensure type safety
- Solutions aim to be both efficient and readable
- Clone the repository
- Import as a Maven project
- Browse the problems in order, starting from P01
- Run tests to verify your understanding
- Check the test cases for usage examples
Each problem's implementation and its corresponding test class can be studied independently, making it easy to focus on specific concepts or challenges.