The algorithm basically gives the user the logic behind solving any particular problem. Algorithms are basic for developing any source code.
Algorithms are generally created irrespective of any particular programming language and it is a step by step procedure, which defines a set of instructions to be executed in particular order to get desired output.
There are various types of the algorithm such as Searching, Sorting, Inserting, Deleting, Updating the list of elements.
A proper algorithm should be unambiguous, have well-defined input and output, finite in nature, feasible and its steps should be independent.
After writing an algorithm for a particular question you can analyze the complexity of it on the basis of two factors :
1. Time Complexity
2. Space Complexity
These are two factors based on which the complexity of an algorithm is defined.
Time complexity defines the amount of time taken by code to run. It is defined with the notation of theta.
Space Complexity defines the amount of space taken by code while it is running.
Comments
Appreciate the author by telling what you feel about the post 💓
No comments yet.
Be the first to express what you feel 🥰.
Please Login or Create a free account to comment.