Article View: alt.pl.comp.lang.csharp
Article #21620Re: Struktura danych [laik]
From: mk
Date: Tue, 22 Jun 2010 11:58
Date: Tue, 22 Jun 2010 11:58
36 lines
1935 bytes
1935 bytes
Michał wrote:
...
> Prosił bym o pomoc jakiej struktury danych mam użyć i jak to
> zaimplementować. Wiem, że w C# są już metody do sorotiwania... ale na tym
> moja wiedza się kończy.
>
> Dane będę wczytywane z klawiatury lub pliku txt ale z tym to już sobie
> poradzę.
>
> Kwestia jak to strukturę danych mądrze zrobić i zaimplementować.
>
Ja bym to raczej nazwał klasą niż strukturą. Np tak:
class Osoba
{
Int Wiek
String Imie
String Nazwisko
...
}
Następnie tworzysz objekty tej klasy i dodajesz to do listy (poczytaj w
necie o kolekcjach a w szczególności o "List").
W liście masz już metodę sort, którą możesz modyfikować wg uznania
(czyli wybierasz sobie po czym chcesz sortować)
...
Ha, akurat miałem otwarte w przeglądarce :)
http://www.developerfusion.com/code/5513/sorting-and-searching-using-c-lists/
Tam masz wszystko wyłożone na tacy.
MK
Technical Details
Message-ID:
<4c20a551$0$19169$65785112@news.neostrada.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!feeder.erje.net!xlned.com!feeder1.xlned.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.246.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mailReferences:
<hvq7h9$2nu$1@node2.news.atman.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!feeder.erje.net!xlned.com!feeder1.xlned.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.246.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail Date: Tue, 22 Jun 2010 13:58:05 +0200 From: mk <mk@nospam.com> User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 Newsgroups: alt.pl.comp.lang.csharp Subject: Re: Struktura danych [laik] References: <hvq7h9$2nu$1@node2.news.atman.pl> In-Reply-To: <hvq7h9$2nu$1@node2.news.atman.pl> Lines: 36 Message-ID: <4c20a551$0$19169$65785112@news.neostrada.pl> Organization: Telekomunikacja Polska NNTP-Posting-Host: 79.189.213.122 X-Trace: 1277207889 unt-rea-a-01.news.neostrada.pl 19169 79.189.213.122:62492 X-Complaints-To: abuse@news.neostrada.pl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit