Re: Euphoria's identity/philosophy -- Where is the focus?

new topic     » goto parent     » topic index » view thread      » older message » newer message
Spock said...

I wonder why nobody picked this up sooner? Of course, it did give me a chance to have a good rant..

Spock

include std/sort.e 
 
sequence testdata = 
{ {1,1}, 
  {2,1}, 
  {2,2}, 
  {1,2}, 
  {3,1}, 
  {2,3}, 
  {2,4}, 
  {1,3}, 
  {2,5}, 
  {3,2} } 
 
? sort(testdata) 
/* 

{ 
  {1,1}, 
  {1,2}, 
  {1,3}, 
  {2,1}, 
  {2,2}, 
  {2,3}, 
  {2,4}, 
  {2,5}, 
  {3,1}, 
  {3,2} 
} 
*/ 

The simple answer is that "often" it does not matter if the sort is stable.

The "real" answer is we need your help. Every rant does help but arguments with source-code speak louder.

It is only logical that there should be a choice of sorting algorithms.

I just learned of the Timsort algorithm which is used in Python and Java. This is a stable sort with a hybrid algorithm. It takes about 1300 lines of C code.

Looking forward to seeing your solution.

_tom

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu