Welcome to DSAJourney, a project dedicated to exploring and implementing data structures and algorithms (DSA) in Kotlin and Java. This repository includes solutions to common algorithmic problems, such as string permutations.
This project was initially written in Java and has been transformed into a Kotlin-based project to leverage Kotlin's modern features and concise syntax. The repository contains implementations of various data structures and algorithms, along with examples and explanations.
DSAJourney/
├── src/
│ ├── Main.java # Entry point for the project
│ └── string_permutation/ # Folder for string permutation problem
│ ├── StringPermutation.kt # Kotlin implementation of string permutations
│ └── input.txt # Sample input file for testing
├── .gitignore # Git ignore rules
├── README.md # Project documentation
└── .git/ # Git configuration files
The string permutation problem involves generating all possible permutations of a given string. This is a common problem in combinatorics and is useful in various applications such as generating passwords, solving puzzles, and more.
- Input: A string is read from the
input.txtfile. - Processing: The program generates all permutations of the string using recursion.
- Output: The permutations are printed to the console.
- Kotlin-based Implementation: Clean and concise code written in Kotlin.
- Beginner-Friendly: Easy-to-understand examples for learning DSA concepts.
- Scalable: Designed to grow with additional algorithms and data structures.
- Kotlin Compiler: Install Kotlin from Kotlin's official website.
- Java Development Kit (JDK): Ensure JDK 8 or higher is installed.
- Git: Install Git to clone the repository.
-
Clone the repository:
git clone https://github.com/mahersavara/DSAJourney.git cd DSAJourney -
Compile and run the project:
kotlinc src/Main.kt -include-runtime -d Main.jar java -jar Main.jar
-
Clone the Repository:
git clone https://github.com/mahersavara/DSAJourney.git cd DSAJourney -
Navigate to the
string_permutationFolder:cd src/string_permutation -
Compile and Run the Program:
- For Kotlin:
kotlinc StringPermutation.kt -include-runtime -d StringPermutation.jar java -jar StringPermutation.jar
- For Java (if implemented in Java):
javac Main.java java src.Main
- For Kotlin:
-
Input File:
- Modify the
input.txtfile to include your desired string for testing. - Example:
abc
- Modify the
-
Output:
- The program will print all permutations of the input string to the console.
- Example:
Input String: abc Permutations: abc acb bac bca cab cba
- Modify the
Main.ktfile to add your own algorithms or data structures. - Use this project as a template for your DSA learning journey.
Contributions are welcome! If you'd like to contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -m "Add your feature description" - Push to your branch:
git push origin feature/your-feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Inspired by the need to make DSA learning accessible and fun.
- Special thanks to the Kotlin and GitHub communities for their amazing tools and support.
For questions or feedback, feel free to reach out:
- GitHub: mahersavara