Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How many ways to write the Algorithm?

0
Posted

How many ways to write the Algorithm?

0

In computer programming, there are often many different ways algorithms to accomplish any given task. Each algorithm has advantages and disadvantages in different situations.Each algorithm also has a different cost and a different travel time Sorting is one place where a lot of research has been done, because computers spend a lot of time sorting lists. Here are five different algorithms that are used in sorting: Bin sort, Merge sort, Bubble sort, Shell sort, Quicksort… If you have a million integer values between 1 and 10 and you need to sort them, the bin sort is the right algorithm to use. If you have a million book titles, the quicksort might be the best algorithm. By knowing the strengths and weaknesses of the different algorithms, you pick the best one for the task at hand.

0

This is actually more a question in Computability/Formal Languages & Automata. There are infinite ways of writing an algorithm or program for that matter. This can be rigorously proved using a turing machine and an abstract notion of an algorithm being a program on a turing machine that solves a given problem. Consider an optimal algorithm for a given problem, you can always add unnecessary steps that do nothing and yield the same results. So really you’ve written an algorithm that solves the same problem, only slower.

0

I can’t exactly answer due to the fact you have not given what you want the algorith to do, but their are limitless ways you can write various algorithms.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.