+ 1
Why we need algorithms?
For example Sorting algorithms: In python we can use sort() method. But these sorting algorithm make same thing like sort() method. but these algorithms use more lines of code. Why we need these algorithms. I am confused please help me.
7 odpowiedzi
+ 4
An algorithm is important in optimizing a computer program according to the available resources. . Ultimately when anyone decide to solve a problem through better algorithms than searching for the best combination of program speed and least amount of memory consumption is desired.
+ 7
Implementing algorithms yourself not only give you more understanding of how the algorithm works but also gives you more control on algorithm to alter it according to your needs.
+ 6
It is similar to asking why you are taught addition/subtraction when you can always use a calculator.
+ 2
With regards to Sorting Algorithms, there are several contributing factors to selecting the "best" and in order to do so, you need to have a working knowledge of these algorithms; not all sorting algorithms are created equal and knowing when to use which is the key contributing factor to determine "best". Also, knowing Big O Notation will help in identifying which sorting method to go with. They nearly all have cases where they are valuable. Mergesort is excellent when you get into distributed processes. Insertion sort is useful for small lists and is a good base case for the recursive sorts. Even Bubble sort is useful for nearly-sorted lists, especially if you don’t need perfect ordering immediately. Radix sorts are useful for certain types of data.
+ 2
The type of sorting algorithm you need to use depends on what kind of data hour are sorting. Certain types of data are sorted better using one algorithm than another.
+ 1
Allamprabhu Hiremath
https://stackoverflow.com/questions/10948920/what-algorithm-does-pythons-sorted-use#:~:text=3%20Answers&text=JUMP_LINK__&&__Python__&&__JUMP_LINK%20uses%20an%20algorithm%20called,in%20the%20Python%20programming%20language.
Hope it will give an idea about it.✌