algoritmus

vajk fekete halaloszto at yahoo.co.uk
Fri Dec 1 09:48:22 CET 2006


hat hogyne! Bar nekunk Poppe tartotta, de ugyanebben a szellemben.

A mitirki feladataok, ooh. C++ zh-n volt olyan, hogy direkt ugy volt csinalva hogy ha elnezted hogy milyen sorrendben futnak le a konstruktorok, akkor az jott ki hogy megbux. aztan nem tudtad hogy peonkodik, vagy elnezted.

vajk

----- Original Message ----
From: Papp Zoltán <zombi at c2.hu>
To: elektro at tesla.hu
Sent: Friday, 1 December, 2006 12:10:44 AM
Subject: Re: algoritmus

2006.11.30. 20:53:45 dátumon vajk fekete <halaloszto at yahoo.co.uk> írta:

> void quick_sort (element_t *table, int length)
> {
>   element_t temp, *left=table, *right=table+length-1;
>   keytype reference_key = table[length/2].key;   /* for partitioning */
>
>   do {                                           /* partitioning */
>     while (left->key < reference_key)  left++;   /* search from left */
>     while (reference_key < right->key) right--;  /* search from right */
>     if (left <= right) {
>       temp = *left;  *left++ = *right;  *right-- = temp;   /* swap, then  
> ...*/
>     }                                        /* ... bypass swapped  
> elements */
>   } while (left <= right);
>   if (table<right)  quick_sort (table,right-table+1);
>   if (left<table+length-1)  quick_sort(left,table+length-left);
> }
>
>
> Hat ez tokeletes pelda arra hogyan lehet a C sajatossagait kihasznalni  
> olvashatatlan,
> karbantarthatatlan kod irasara.

Hát kérem nemhiába Pongor írta. Te nem vizsgázál nála? Amikor elénktolta a  
3 soros C programot (faltól falig minden sor), hogy mit ír ki, tele  
c=++a+b+++++c és hasonló hülyeségekkel.
Ráadásul papíron kellett (szintaktikailag is helyes!) tökéletes programot  
írni...

-- 
Papp Zoltán
OneWay Electronics

-----------------------------------------
          elektro[-flame|-etc]







		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com


More information about the Elektro mailing list