Coder Social home page Coder Social logo

avantikachauhann / algorithm-alchemy Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 26.0 728 KB

A curated collection of programs implemented in C++, Java, Python.

Java 40.30% Python 31.76% C++ 27.95%
100daysofcode 100daysofjava 100daysofpython algorithms data-structures dsa good-first-issue gssoc23 ssoc2023 100daysofcpp

algorithm-alchemy's Introduction

Data-Structures-and-Algorithm

Welcome to my Data Structures and Algorithm repository!๐Ÿ‘‹๐Ÿป Here, you will find a curated collection of programs implemented in Java, Python, and C++. These programs cover a wide range of data structures and algorithms, including but not limited to arrays, linked lists, trees, graphs, sorting algorithms, searching techniques, and dynamic programming.

Whether you are a beginner looking to understand the fundamentals or an experienced programmer aiming to reinforce your skills, this repository is designed to cater to all levels of expertise. Each program comes with detailed explanations and code comments to aid in your understanding.

By exploring this repository, you will deepen your understanding of how data structures work, learn various algorithms, and become proficient in implementing them using Java, Python, or C++. You can use these programs as a reference, study material, or even as a starting point for your own projects.

So delve into our collection and embark on a journey of discovery and learning. Sharpen your problem-solving skills, gain insights into efficient coding practices, and strengthen your grasp on crucial concepts in the world of data structures and algorithms. Happy coding! :)

โญ๏ธ If you find my repository useful or if you like it, please consider giving it a star. Your support encourages me to continue working on it and improve its functionality. Thank you! โญ๏ธ

Instructions for Contributing to the Repository:

  1. Start by exploring the existing issues in the repository and identify an issue you are interested in or something you want to work on that is not already there.

  2. If the feature or bug fix you want to work on is not present as an issue, create a new issue for it. Clearly explain the problem or feature request and wait for it to get assigned to you.

  3. Once the issue is assigned to you, begin working on it. If there is an existing issue related to your chosen topic, make sure it is assigned to you before proceeding.

  4. Fork the repository:

    a. Go to the repository's website (e.g., GitHub) and click on the "Fork" button.

    b. This will create a copy of the repository under your GitHub account.

  5. Clone the forked repository:

    a. Open a terminal and navigate to the location where you want to store the repository.

    b. Use the git clone command followed by the URL of the forked repository to create a local copy.

  6. Create a new branch:

    a. Switch to the repository's directory using the terminal.

    b. Create a new branch using the git checkout -b branch-name command.

    c. Replace "branch-name" with a descriptive name for your branch (e.g., "add-binary-search").

  7. Add your code:

    a. Write your data structure or algorithm code in the appropriate folder.

    b. Include comments that explain your approach, time complexity, and space complexity.

    c. Provide a sample input and output to demonstrate the functionality of your code.

    d. Add comments to clarify to explain the logic and any important steps.

  8. Ensure your code style matches the repository style:

    a. Review the existing code in the repository to understand the preferred style.

    b. Follow the established naming conventions, indentation, and formatting.

    c. Use meaningful variable and function names that convey the purpose of the code.

  9. Test your code:

    a. Verify that your code is correct by running relevant test cases.

    b. Ensure all sample inputs produce the expected outputs.

    c. Consider edge cases and handle them appropriately, if applicable.

  10. Commit and push your changes:

    a. Use git add -A to stage all the changes you made.

    b. Run git commit -m "Brief description of your changes" to commit your changes.

    c. Finally, use git push origin branch-name to push your changes to the forked repository.

  11. Create a pull request:

    a. Go to the forked repository on the website (e.g., GitHub).

    b. Click on the "New Pull Request" button.

    c. Select the original repository from the base repository dropdown.

    d. Choose your branch in the "compare" dropdown.

    e. Provide a descriptive title and detailed description for your pull request including the issue number.

    f. Click on the "Create Pull Request" button to submit your changes for review.

  12. Review and address feedback:

    a. Monitor the pull request for any feedback or suggestions from the maintainer.

    b. Make necessary changes to your code based on the feedback received.

    c. Commit and push the changes to the same branch.

  13. Wait for approval:

    a. The maintainer will review your code and either approve or provide further feedback.

    b. Once approved, your changes will be merged into the main repository.

  14. Once approved, your code will be merged into the main repository. Congratulations on your contribution!

Code Formatting Guidelines

FOR CONTRIBUTION IN C++

/*
Approach:
- Explain the general approach or algorithm behind the code in brief.

Time Complexity: O(n)
- Explain the time complexity of the code.

Space Complexity: O(1)
- Explain the space complexity of the code.

Sample Input:
- Provide an example input.

Sample Output:
- Provide the expected output for the given input.

*/

#include <iostream>
using namespace std;

int main() {
    // Main function to test the code
    return 0;
}

FOR CONTRIBUTION IN JAVA

/*
Approach:
- Explain the general approach or algorithm behind the code in brief.

Time Complexity: O(n)
- Explain the time complexity of the code.

Space Complexity: O(1)
- Explain the space complexity of the code.

Sample Input:
- Provide an example input.

Sample Output:
- Provide the expected output for the given input.

*/

public class CodeExample {
    public static void main(String[] args) {
        // Main function to test the code
    }
}

FOR CONTRIBUTION IN PYTHON

'''
Approach:
- Explain the general approach or algorithm behind the code in brief.

Time Complexity: O(n)
- Explain the time complexity of the code.

Space Complexity: O(1)
- Explain the space complexity of the code.

Sample Input:
- Provide an example input.

Sample Output:
- Provide the expected output for the given input.
'''

def code_example():
    # Function to implement the code logic
    pass

if __name__ == "__main__":
    code_example()    # Call the function to test the code

Note: You should replace the comments with the actual explanation, complexities, sample input, output, and code logic as per your specific requirements.

algorithm-alchemy's People

Contributors

adieldror avatar arunvatsyayan avatar avantikachauhann avatar evangeka avatar fischkopdev avatar iligeoili avatar johnwickfirst avatar kom-senapati avatar manithld avatar mownika-senthamilselvan avatar owings671 avatar raj-khanna1 avatar sandboxhead avatar subhadtech avatar theanantchoubey avatar v-m-tejus avatar zyphrflaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

algorithm-alchemy's Issues

Missing Curly Brace in DiamondPattern.java

In the file DiamondPattern.java, there seems to be a missing closing curly brace (}), which results in a syntax error. The exact error message I'm seeing is: Syntax error, insert "}" to complete ClassBodyJava(1610612976).

Please look into this and fix the issue, or let me know if I can provide more information.

[feat]: Create C++ Folder

Description

  • No Folder is Available for C++ Contributions

Solution

  • Add C++ Folder for Contributions

Patterns in python and java

I want to add the following 3 patterns in Python and Java to your repository.

  1. Hollow Diamond

    • image
  2. Floyd's Triangle Pattern

    • image
  3. Pascal Triangle Pattern

    • image

[feat]: Create folder for graph-algorithms

Create a folder for graph-algorithms like Dijkstra, DFS,...
It should contain one datastructure representation of graphs like adjacencyfields for a standard ussage in future graph-algorithms

Resource Leak in PalindromeNumber.java

In the PalindromeNumber.java file, there seems to be a resource leak warning. It appears that the Scanner object, 'scanner', is never closed.

The specific warning message I'm seeing is: "Resource leak: 'scanner' is never closed".

This might lead to resource leaks and other unexpected behavior. Please review the code and add necessary close() statements or try to use try-with-resources, which ensures that each resource is closed at the end of the statement.

Public type CycleSortExample not defined in its own file

In the CycleSort.java file, there is a problem with the CycleSortExample class. Java conventions require that each public class should be defined in its own file, which is not the case here. This may lead to compilation errors or unexpected behavior.

The specific error message I'm getting is: "The public type CycleSortExample must be defined in its own file".

Please review this and resolve the issue, or let me know if I can provide any additional information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.