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); } } }
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()); }
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()); }
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); } }
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); }
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); }
public LinkedHashEntry(int anahtar, Otel otel) { this.plakaKodu = anahtar; this.otel = otel; this.next = null; }