[Lazarus] clarification / Re: constant-highlight ? [Re: quick opinion poll / pascal highlighting "case"]

Reimar Grabowski reimgrab at web.de
Thu May 27 21:29:26 CEST 2010


On Thu, 27 May 2010 13:53:17 +0100
Martin <lazarus at mfriebe.de> wrote:

> IMHO the exact style ot intend is mostly a 
> matter of taste. Wahtever you grew up with (or are used too), seems most 
> readable.
+1

procedure quicksort;
   procedure sort(l,r: index);
      var i,j: index; x,w: item;
   begin i := l; j := r;
      x := a[(l+r) div 2];
      repeat
         while a[1].key < x.key do i := i+1;
         while x.key < a[j].key do j := j-1;
         if i <= j then
         begin w := a[i]; a[i] := a[j]; a[j] := w;
            i := i+1; j := j-1
         end;
      until i > j;
      if l < j then sort(l,j);
      if i < r then sort(i,r)
   end;
   begin sort(1,n)
end;

Dr. Dr. h. c. Niklaus Wirth
Algorithmen und Datenstrukturen
2. Edition
Stuttgart 1979
page 117

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?




More information about the Lazarus mailing list