Re: Which Algorithms are used most often ?



On Sep 29, 1:35 am, arnuld <sunr...@xxxxxxxxxxxxxxx> wrote:
I posted the implementation of Bubble Sort in C on comp.lang.c and I was
told Bubble Sort is almost always a poor choice. Then I learned Insertion-
Sort and posted a C implementation of it and again I got replies that
except of a few situations insertion sort too is a bad idea.

So I ask, I am learning Algorithms and want to learn only those ones
which are either used most often or useful for practical purposes.

This isn't a great strategy. It sounds efficient, but it's not.
Mastering a spotty collection of "most used or useful" algorithms will
leave you with just that, and you'll remain in the little leagues
until you give in and start the real work.

Good algorithm books and courses are organized in a logical
progression that builds a framework for algorithmic thinking in your
head. You finish with a kind of logical skeleton for some families of
algorithms. Some of them are really useful. Others are mainly
connective tissue that make your knowledge hang together. Real
problems seldom fall exactly on the skeleton, but rather in the
spaces. You thicken the skeleton over time by solving as many problems
as you can get your head around. You never know which bit of knowledge
is going to help in advance. It's a lifetime sport.

An example is bubblesort. It's never the right solution for a general
sorting problem. But when you implement a polygon raster scanning
algorithm and need to sort the active edge list between scan lines,
where you know in advance that elements are going to shift small
distances or not at all, then a bubblesort-ish algorithm is exactly
what you want.

.



Relevant Pages

  • Re: Bubble Sort in C
    ... contest, but how often do the masses experience such a contest? ... a common choice in algorithms teaching courses, ... sort is easily just as simple and far more effective. ...  Now, if bubble ...
    (comp.lang.c)
  • Re: "Sorting" assignment
    ... should have access to education in the first place. ... Cormen's Algorithms, nobunny "excels". ... I said that in learning bubble sort, ... opened itself to all Texan high schoolers with a floor GPA), Dijkstra ...
    (comp.programming)
  • Re: Creating my own method for sorting an array
    ... any other way than by using the .sort method, ... with class Array and probably algorithms in general. ... Maybe it's a bit early to start writing tests when someone is starting ... certainly got more kick out of a working program than a working unit ...
    (comp.lang.ruby)
  • Re: Sorting in VBA (andVB)
    ... but I specifically chose to use numeric data as that permits comparison> among sorting algorithms for a given data type. ... > same effect in ALL the string algorithms, so it should not affect the> performance comparisons. ... > WordBasic.SortArray is using an ineffective algorithm, e.g., compare with> the results using either VB 6 ListBox sort or Excel Sort. ... The>> InsertionString routine in your modSortHK.bas module gives precisely this>> sort order. ...
    (microsoft.public.word.vba.general)
  • Re: allowing my AI to dynamically change its own structure
    ... the only kind of sort you knew about. ... another part of the program internally explored the search space of ... "it rains" because the laws of physics were changed. ... If you want to discuss the behavior of algorithms that adapt their own ...
    (comp.ai)