コード例 #1
0
        public void OtelEkle(int plakaKodu, Otel otel)
        {
            int hash = plakaKodu - 1;

            if (table[hash] == null)
            {
                table[hash] = new LinkedHashEntry(plakaKodu, otel);
            }
            else
            {
                LinkedHashEntry entry = table[hash];
                while (entry.Next != null && entry.Anahtar != plakaKodu)
                {
                    entry = entry.Next;
                }
                if (entry.Anahtar == plakaKodu)
                {
                    entry.Deger = otel;
                }
                else
                {
                    entry.Next = new LinkedHashEntry(plakaKodu, otel);
                }
            }
        }
コード例 #2
0
        public List <Otel> IlOtelleriPuanli(int plakaKodu)
        {
            List <Otel> hotels = new List <Otel>();
            int         hash   = plakaKodu - 1;

            if (table[hash] == null)
            {
                return(null);
            }
            else
            {
                LinkedHashEntry entry = table[hash];
                while (entry != null && entry.Anahtar != plakaKodu)
                {
                    hotels.Add(entry.Deger);
                    entry = entry.Next;
                }
            }

            HeapPuan heapPuan = new HeapPuan(hotels.Count);

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


            return(heapPuan.siralanmisGetir());
        }
コード例 #3
0
        public List <Otel> IlIlceOtelleriYildizli(int plakaKodu, string ilceAdi)
        {
            List <Otel> hotels = new List <Otel>();
            int         hash   = plakaKodu - 1;

            if (table[hash] == null)
            {
                return(null);
            }
            else
            {
                LinkedHashEntry entry = table[hash];
                while (entry != null && entry.Anahtar != plakaKodu)
                {
                    if (entry.Deger.Ilce == ilceAdi)
                    {
                        hotels.Add(entry.Deger);
                        entry = entry.Next;
                    }
                }
            }

            HeapYildiz heapYildiz = new HeapYildiz(hotels.Count);

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


            return(heapYildiz.siralanmisGetir());
        }
コード例 #4
0
        public void OtelEkle(int plakaKodu, Otel otel)
        {
            int hash = (plakaKodu) - 1;

            if (table[hash] == null)
            {
                table[hash] = new LinkedHashEntry(plakaKodu, otel);
            }
            else
            {
                LinkedHashEntry entry = table[hash];
                while (entry.Next != null)
                {
                    entry = entry.Next;
                }

                entry.Next = new LinkedHashEntry(plakaKodu, otel);
            }
        }
コード例 #5
0
        public List <Otel> IlOtelleri(int plakaKodu)
        {
            List <Otel> hotels = new List <Otel>();
            int         hash   = plakaKodu - 1;

            if (table[hash] == null)
            {
                return(null);
            }
            else
            {
                LinkedHashEntry entry = table[hash];
                while (entry != null)
                {
                    hotels.Add(entry.Deger);
                    entry = entry.Next;
                }
            }
            return(hotels);
        }
コード例 #6
0
        public List <Otel> IlIlceOtelleri(int plakaKodu, string ilceAdi)
        {
            List <Otel> hotels = new List <Otel>();
            int         hash   = plakaKodu - 1;

            if (table[hash] == null)
            {
                return(null);
            }
            else
            {
                LinkedHashEntry entry = table[hash];
                while (entry != null && entry.Anahtar != plakaKodu)
                {
                    if (entry.Deger.Ilce == ilceAdi)
                    {
                        hotels.Add(entry.Deger);
                        entry = entry.Next;
                    }
                }
            }
            return(hotels);
        }
コード例 #7
0
 public LinkedHashEntry(int anahtar, Otel otel)
 {
     this.plakaKodu = anahtar;
     this.otel      = otel;
     this.next      = null;
 }