コード例 #1
0
        public void VeriEkle(Otel otel)
        {
            int hash = GetKeyValue(otel.il);

            if (tablo[hash] == null)
            {
                tablo[hash] = new LinkedHashEntry(otel.adi, otel);
            }
            else
            {
                LinkedHashEntry entry = tablo[hash];
                while (entry.sonraki != null && entry.anahtar != otel.adi)
                {
                    entry = entry.sonraki;
                }
                if (entry.anahtar == otel.adi)
                {
                    entry.otelBilgileri = otel;
                }
                else
                {
                    entry.sonraki = new LinkedHashEntry(otel.adi, otel);
                }
            }
        }
コード例 #2
0
        public List <Otel> YildizliIlVeriAl(string ilIsmi)
        {
            int         hash    = GetKeyValue(ilIsmi);
            List <Otel> oteller = new List <Otel>();

            if (tablo[hash] == null)
            {
                return(null);
            }
            else
            {
                LinkedHashEntry entry = tablo[hash];

                while (entry != null)
                {
                    oteller.Add(entry.otelBilgileri);
                    entry = entry.sonraki;
                }
            }

            YildizliHeap yildizliHeap = new YildizliHeap(oteller.Count);

            for (int i = 0; i < oteller.Count; i++)
            {
                yildizliHeap.Insert(oteller[i]);
            }

            return(yildizliHeap.SiraliVeriAl());
        }
コード例 #3
0
        public List <Otel> VeriAl(string ilIsmi)
        {
            int         hash    = GetKeyValue(ilIsmi);
            List <Otel> oteller = new List <Otel>();

            if (tablo[hash] == null)
            {
                return(null);
            }
            else
            {
                LinkedHashEntry entry = tablo[hash];

                while (entry != null)
                {
                    oteller.Add(entry.otelBilgileri);
                    entry = entry.sonraki;
                }
            }

            return(oteller);
        }
コード例 #4
0
 public LinkedHashEntry(string anahtar, Otel otel)
 {
     this.anahtar       = anahtar;
     this.otelBilgileri = otel;
     this.sonraki       = null;
 }