Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.sci.electronics > #354525

Re: Software - mittlerweile ein Standard-Problem?

From Helmut Schellong <var@schellong.biz>
Newsgroups de.sci.electronics
Subject Re: Software - mittlerweile ein Standard-Problem?
Date 2024-07-16 11:17 +0200
Message-ID <v75dqr$luuj$1@solani.org> (permalink)
References (6 earlier) <v70hi6$560c$4@gwaiyur.mb-net.net> <6693D07E.DDC1029E@Berger-Odenthal.De> <v73pb8$qe4n$1@dont-email.me> <slrnv9auo2.5dpi.als@mordor.angband.thangorodrim.de> <6695A950.B8ECE86F@Berger-Odenthal.De>

Show all headers | View raw


Axel Berger wrote:
> Alexander Schreiber wrote:
>> Weil einem das Ding oft als erster Sortieralgorithmus erklärt wird (und
>> man dann selber schreiben darf) und andere teilweise nur erwähnt werden.
> 
> Mir hat es keiner erklärt, ich bin komplett selbst draufgekommen. Das
> sehr große Ahaerlebnis war, die innere Schleife rückwärts laufen zu
> lassen. Zuerst liefen beide vorwärts. auch das wird der Rest immer
> besser vorsortiert, aber verkehrt herum. Am Ende wird dann bei jedem
> einzelnen Vergleich getauscht -- nicht nur das Schlüsselfeld sondern
> alle Felder.

Mein erster Sortier-Algorithmus war Quicksort.
Ich habe mehrere Implementationen davon.
Rekursiv und nicht-rekursiv.

for (;  p<pe;  ++p,--pe)  if (*p>*pe)  a=*p, *p=*pe, *pe=a;

Diese simple Vorsortierung reduziert die Durchläufe in der nachfolgenden
do-while-Schleife (mit zwei solchen Schleifen) um etwa ein Drittel.

Die Schleife oben läuft mit den beiden Pointern vom Anfang bzw. vom Ende, bis diese sich treffen.
Das Ganze ist prinzipiell ein (halber) Quicksort.


-- 
Mit freundlichen Grüßen
Helmut Schellong   var@schellong.biz
http://www.schellong.de/c.htm  http://www.schellong.de/c2x.htm  http://www.schellong.de/c_padding_bits.htm
http://www.schellong.de/htm/bishmnk.htm  http://www.schellong.de/htm/rpar.bish.html  http://www.schellong.de/htm/sieger.bish.html
http://www.schellong.de/htm/audio_proj.htm  http://www.schellong.de/htm/audio_unsinn.htm  http://www.schellong.de/htm/tuner.htm
http://www.schellong.de/htm/string.htm  http://www.schellong.de/htm/string.c.html  http://www.schellong.de/htm/deutsche_bahn.htm
http://www.schellong.de/htm/schaltungen.htm  http://www.schellong.de/htm/math87.htm  http://www.schellong.de/htm/dragon.c.html

Back to de.sci.electronics | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Software - mittlerweile ein Standard-Problem? Helmut Schellong <var@schellong.biz> - 2024-07-11 21:32 +0200
  Re: Software - mittlerweile ein Standard-Problem? Ralph Aichinger <ralph@pi.h5.or.at> - 2024-07-11 19:44 +0000
    Re: Software - mittlerweile ein Standard-Problem? Helmut Schellong <var@schellong.biz> - 2024-07-12 15:07 +0200
      Re: Software - mittlerweile ein Standard-Problem? Ralph Aichinger <ralph@pi.h5.or.at> - 2024-07-12 13:45 +0000
        Re: Software - mittlerweile ein Standard-Problem? Helmut Schellong <var@schellong.biz> - 2024-07-12 17:39 +0200
          Re: Software - mittlerweile ein Standard-Problem? Ralph Aichinger <ralph@pi.h5.or.at> - 2024-07-12 16:24 +0000
            Re: Software - mittlerweile ein Standard-Problem? Helmut Schellong <var@schellong.biz> - 2024-07-12 21:54 +0200
              Re: Software - mittlerweile ein Standard-Problem? Ralph Aichinger <ralph@pi.h5.or.at> - 2024-07-12 21:39 +0000
                Re: Software - mittlerweile ein Standard-Problem? Stefan <invalid@ignore.invalid> - 2024-07-13 07:06 +0200
                Re: Software - mittlerweile ein Standard-Problem? Ulf_Kutzner <Ulf.Kutzner@web.de> - 2024-07-13 09:45 +0000
                Re: Software - mittlerweile ein Standard-Problem? Ralph Aichinger <ralph@pi.h5.or.at> - 2024-07-13 09:52 +0000
                Re: Software - mittlerweile ein Standard-Problem? Helmut Schellong <var@schellong.biz> - 2024-07-13 13:42 +0200
              Re: Software - mittlerweile ein Standard-Problem? Rolf Bombach <rolfnospambombach@invalid.invalid> - 2024-07-13 22:05 +0200
                Re: Software - mittlerweile ein Standard-Problem? Helmut Schellong <var@schellong.biz> - 2024-07-13 22:52 +0200
            Re: Software - mittlerweile ein Standard-Problem? Rolf Bombach <rolfnospambombach@invalid.invalid> - 2024-07-13 21:39 +0200
              Re: Software - mittlerweile ein Standard-Problem? Olaf Schultz <o.schultz@enhydralutris.de> - 2024-07-13 21:54 +0200
                Re: Software - mittlerweile ein Standard-Problem? Heinz Schmitz <sch@example.invalid> - 2024-07-14 11:14 +0200
                Re: Software - mittlerweile ein Standard-Problem? Rolf Bombach <rolfnospambombach@invalid.invalid> - 2024-07-15 19:48 +0200
                Re: Software - mittlerweile ein Standard-Problem? Gerrit Heitsch <gerrit@laosinh.s.bawue.de> - 2024-07-15 20:04 +0200
                Re: Software - mittlerweile ein Standard-Problem? Volker Bartheld <news2024@bartheld.net> - 2024-07-15 20:08 +0200
                Re: Software - mittlerweile ein Standard-Problem? Alexander Schreiber <als@usenet.thangorodrim.de> - 2024-07-15 21:44 +0200
                Re: Software - mittlerweile ein Standard-Problem? Helmut Schellong <var@schellong.biz> - 2024-07-15 21:39 +0200
                Re: Software - mittlerweile ein Standard-Problem? Gerrit Heitsch <gerrit@laosinh.s.bawue.de> - 2024-07-15 21:53 +0200
                Re: Software - mittlerweile ein Standard-Problem? Alexander Schreiber <als@usenet.thangorodrim.de> - 2024-07-15 21:43 +0200
          Re: Software - mittlerweile ein Standard-Problem? Rolf Bombach <rolfnospambombach@invalid.invalid> - 2024-07-13 20:58 +0200
            Re: Software - mittlerweile ein Standard-Problem? Helmut Schellong <var@schellong.biz> - 2024-07-13 22:10 +0200
            Re: Software - mittlerweile ein Standard-Problem? Ralph Aichinger <ralph@pi.h5.or.at> - 2024-07-14 12:50 +0000
              Re: Software - mittlerweile ein Standard-Problem? Axel Berger <Spam@Berger-Odenthal.De> - 2024-07-14 15:19 +0200
                Re: Software - mittlerweile ein Standard-Problem? Rolf Bombach <rolfnospambombach@invalid.invalid> - 2024-07-15 20:21 +0200
                Re: Software - mittlerweile ein Standard-Problem? Alexander Schreiber <als@usenet.thangorodrim.de> - 2024-07-15 21:39 +0200
                Re: Software - mittlerweile ein Standard-Problem? Axel Berger <Spam@Berger-Odenthal.De> - 2024-07-16 00:57 +0200
                Re: Software - mittlerweile ein Standard-Problem? Gerrit Heitsch <gerrit@laosinh.s.bawue.de> - 2024-07-16 07:47 +0200
                Re: Software - mittlerweile ein Standard-Problem? Helmut Schellong <var@schellong.biz> - 2024-07-16 11:17 +0200
                Re: Software - mittlerweile ein Standard-Problem? Volker Bartheld <news2024@bartheld.net> - 2024-07-16 09:22 +0200
        Re: Software - mittlerweile ein Standard-Problem? Rolf Bombach <rolfnospambombach@invalid.invalid> - 2024-07-13 20:50 +0200
          Re: Software - mittlerweile ein Standard-Problem? Hergen Lehmann <hlehmann-usenet24@snafu.de> - 2024-07-13 21:19 +0200
            Re: Software - mittlerweile ein Standard-Problem? Rolf Bombach <rolfnospambombach@invalid.invalid> - 2024-07-15 20:23 +0200
              Re: Software - mittlerweile ein Standard-Problem? Hergen Lehmann <hlehmann-usenet24@snafu.de> - 2024-07-15 21:33 +0200
  Re: Software - mittlerweile ein Standard-Problem? Falk Dµebbert <falk@duebbert.com> - 2024-07-12 00:00 +0200
    Re: Software - mittlerweile ein Standard-Problem? Helmut Schellong <var@schellong.biz> - 2024-07-12 15:55 +0200
    Re: Software - mittlerweile ein Standard-Problem? Hannes Kuhnert <hannes.kuhnert@gmx.de> - 2024-07-12 20:59 +0200
  Re: Software - mittlerweile ein Standard-Problem? Christian Weisgerber <naddy@mips.inka.de> - 2024-07-11 23:34 +0000
  Re: Software - mittlerweile ein Standard-Problem? Frank Müller <dw2fm@hotmail.com> - 2024-07-12 10:18 +0200
    Re: Software - mittlerweile ein Standard-Problem? Helmut Schellong <var@schellong.biz> - 2024-07-12 15:59 +0200
      Re: Software - mittlerweile ein Standard-Problem? Wilhelm Ernst <newstrap@t-online.de> - 2024-07-12 19:58 +0200
        Re: Software - mittlerweile ein Standard-Problem? Helmut Schellong <var@schellong.biz> - 2024-07-12 20:58 +0200

csiph-web