TheAlgorithms/Java

Add Time Complexity Explanation for Algorithms

Closed this issue · 1 comments

What would you like to Propose?

I propose adding a new feature to the repository that not only documents the time complexity for each algorithm but also explains the concept of time complexity and provides guidelines on how to calculate it. This will help users, especially beginners, understand how time complexity works and how to analyze the efficiency of algorithms.

Issue details

Time Complexity Explanations for Algorithm
Algorithm will include a dedicated section explaining the best-case, average-case, and worst-case time complexity.
This explanation will be added in the form of detailed comments (preferably Javadoc) in the respective algorithm file.
In addition to providing the time complexity values (e.g., O(n), O(n log n)), I will include step-by-step reasoning on how to derive these complexities.

Additional Information

No response

We don't want to overload the repository with auxilliary information, as we are not trying to make it self-contained. The repository is designed to be used alongside a good textbook, and most of the theoretical things would be explained clearly in the textbook. The repository would be used for reference on how to write modern code, as it's difficult for textbooks to catch up with the change, and for finding some specific algorithms that you are interested in.