예제 #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;
 }