22.11.2013 Aufrufe

Programmierstil - IPD Snelting

Programmierstil - IPD Snelting

Programmierstil - IPD Snelting

MEHR ANZEIGEN
WENIGER ANZEIGEN

Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.

YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.

Beispiel 4<br />

Schlecht:<br />

<strong>Programmierstil</strong><br />

Namen und Kommentare<br />

if (first_pointer == begin_of_second) {<br />

// if first list is empty ..<br />

Templist [compare] = Mergelist [second_pointer];<br />

// take element at the second pointer --><br />

// into the Temparray ..<br />

second_pointer++;<br />

// .. and move this pointer to next element.<br />

} //if<br />

Gut:<br />

// if first list is empty, move an element<br />

// from the second list to the temporary.<br />

if (firstPointer == beginOfSecond) {<br />

tempList [compare] = mergeList [secondPointer];<br />

secondPointer++;<br />

}<br />

Prof. Dr.-Ing. G. <strong>Snelting</strong> (Uni Karlsruhe) c○2008 by <strong>IPD</strong> <strong>Snelting</strong> – Programmieren WS 2008/2009 11 / 31

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!