public Heap(int maxHeapSize) { maxSize = maxHeapSize; currentSize = 0; heapArray = new HeapDugumu[maxSize]; o = new Ogrenci_Bilgi(); }
public void Guncelle(Ogrenci_Bilgi b) { bool durum = false; for (int i = 0; i < 100; i++) { if (table[i] != null) { durum = true; table[i].HValue.KisiGuncelle(b); } else { durum = false; } } if (durum == false) { for (int i = 0; i < Listeler.Ogrenciler.Count; i++) { if (Listeler.Ogrenciler[i].OgrenciNumarasi == b.OgrenciNumarasi) { Listeler.Ogrenciler[i] = b; durum = true; } } } }
public string OgrenciSil(Ogrenci_Bilgi o) { if (Listeler.Ogrenciler.Remove(Listeler.Ogrenciler[Listeler.Ogrenciler.Count - 1]) == true) { return("Başarılı"); } else { return("Başarısız"); } }
public bool Insert(Ogrenci_Bilgi ogr) { if (currentSize == maxSize) { return(false); } HeapDugumu newHeapDugumu = new HeapDugumu(ogr); heapArray[currentSize] = newHeapDugumu; MoveToUp(currentSize++); return(true); }
public bool KisiGuncelle(Ogrenci_Bilgi o) { for (int i = 0; i < currentSize; i++) { if (heapArray[i].ogr.OgrenciNumarasi == o.OgrenciNumarasi) { heapArray[i].ogr = o; return(true); } } return(false); }
public bool SistemdenSil(Ogrenci_Bilgi bilgi) { for (int i = 0; i < 100; i++) { if (heapArray[i].ogr.OgrenciNumarasi == bilgi.OgrenciNumarasi) { heapArray[i].ogr = null; return(true); } else { return(false); } } return(false); }
public override void InsertFirst(Ogrenci_Bilgi o) { Node tempHead = new Node { Data = o }; if (Head == null) { Head = tempHead; } else { tempHead.Next = Head; Head = tempHead; } Size++; }
public void Ekle(Ogrenci_Bilgi deger) { İkiliAramaAgacDugumu tempParent = null; İkiliAramaAgacDugumu tempSearch = kok; int sayi = 0; while (tempSearch != null) { tempParent = tempSearch; sayi = string.Compare(tempSearch.veri.OgrenciNumarasi, deger.OgrenciNumarasi); if (sayi == 0) { return; } else if (sayi > 0) { tempSearch = tempSearch.sol; } else { tempSearch = tempSearch.sag; } } İkiliAramaAgacDugumu eklenecek = new İkiliAramaAgacDugumu(deger); if (kok == null) { kok = eklenecek; } else if (sayi > 0) { tempParent.sol = eklenecek; } else { tempParent.sag = eklenecek; } }
public override void InsertLast(Ogrenci_Bilgi o) { Node iter = Head; if (Head == null) { InsertFirst(o); } else { while (iter.Next != null) { iter = iter.Next; } Node eklenecekNode = new Node { Data = o }; eklenecekNode.Next = null; iter.Next = eklenecekNode; } }
public void BolumeOgrenciEkle(Bolum_Bilgi b, Ogrenci_Bilgi o) { int hash = b.BolumNo % size; if (table[hash] != null) { while (table[hash] != null && table[hash].Anahtar != b.BolumNo) { table[hash] = table[hash].Next; } } if (table[hash].Anahtar == b.BolumNo) { bool durum; durum = table[hash].HValue.Ogrenci(o.OgrenciNumarasi); if (durum == false) { table[hash].HValue.Insert(o); } } }
public string BolumdekiOgrencileriGoster(Ogrenci_Bilgi o) { string temp = ""; int hash = o.BolumNo % size; if (table[hash] == null) { return(null); } else { while (table[hash] != null && table[hash].Anahtar != o.BolumNo) { table[hash] = table[hash].Next; } if (table[hash].Anahtar == o.BolumNo) { temp = table[hash].HValue.HeapGörüntüle(); } } return(temp); }
public abstract void InsertLast(Ogrenci_Bilgi o);
private void Form1_Load(object sender, EventArgs e) { Bolum_Bilgi b = new Bolum_Bilgi(); b.BolumAdi = "Yazılım"; b.BolumNo = 0; Listeler.Bolumler.Add(b); Ogrenci_Bilgi o = new Ogrenci_Bilgi(); o.Bolum.AddFirst(b); o.Ad = "Selim"; o.OgrenciNumarasi = "1236"; o.Adres = "Konya"; o.BolumNo = 0; o.BolumAdi = "Yazılım"; o.DogumTarihi = Convert.ToDateTime("30.09.1997"); o.Uyruk = "Türk"; o.İlgiAlani = "Bisiklet Sürmek"; o.Eposta = "*****@*****.**"; o.BasariBelgesi = true; o.YabanciDil = "İngilizce"; o.Telefon = 035825387; list.InsertLast(o); Listeler.Bolumler[0].ogrnumaralari.Add(o); Listeler.mezun_ogrenciler.Ekle(o); Listeler.Ogrenciler.Add(o); dugum.Ekle(o); Bolum_Bilgi c = new Bolum_Bilgi(); Ogrenci_Bilgi a = new Ogrenci_Bilgi(); c.BolumAdi = "Mekatronik"; c.BolumNo = 1; Listeler.Bolumler.Add(c); a.Ad = "Enes"; a.OgrenciNumarasi = "1235"; a.Adres = "Balıkesir"; a.BolumNo = 1; a.BolumAdi = "Mekatronik"; a.Uyruk = "Türk"; a.DogumTarihi = Convert.ToDateTime("13.02.1997"); a.İlgiAlani = "Uyumak"; a.Eposta = "*****@*****.**"; a.NotOrtalamasi = 70; a.BasariBelgesi = false; a.YabanciDil = "İngilizce"; a.Telefon = 05334534676; a.Bolum.AddFirst(c); Listeler.mezun_ogrenciler.Ekle(a); Listeler.Ogrenciler.Add(a); Listeler.Bolumler[1].ogrnumaralari.Add(a); dugum.Ekle(a); list.InsertLast(a); Bolum_Bilgi r = new Bolum_Bilgi(); r.NotOrtalamasi = 91; r.BolumAdi = "Enerji Sistemleri"; r.BolumNo = 2; Listeler.Bolumler.Add(r); Ogrenci_Bilgi q = new Ogrenci_Bilgi(); q.Ad = "Ümit"; q.OgrenciNumarasi = "1234"; q.Adres = "Karaman"; r.BolumNo = 2; q.Uyruk = "İngiliz"; q.BolumAdi = "Enerji Sistemleri"; q.DogumTarihi = Convert.ToDateTime("30.06.1997"); q.İlgiAlani = "Evet de"; q.Eposta = "artı[email protected]"; q.BasariBelgesi = false; q.YabanciDil = "Bütün diller"; q.Telefon = 05334525; list.InsertLast(q); q.Bolum.AddFirst(r); Listeler.mezun_ogrenciler.Ekle(q); Listeler.Ogrenciler.Add(q); Listeler.Bolumler[2].ogrnumaralari.Add(q); dugum.Ekle(q); }
public İkiliAramaAgacDugumu(Ogrenci_Bilgi veri) { this.veri = veri; sol = null; sag = null; }
public HeapDugumu(Ogrenci_Bilgi ogr) { this.ogr = ogr; this.deger = r.NextDouble() * 10d; }