public void DelT(string n, ref uint count) { NodeOfTable tmpCar = list; if (tmpCar.Car.num == n) { list = tmpCar.Next; count++; return; } while (tmpCar.Next.Car.num != n) { tmpCar = tmpCar.Next; } tmpCar.Next = tmpCar.Next.Next; count++; if (tmpCar.Next != null) { tmpCar.Next.Prev = tmpCar; count++; } }
public void SaveFile(StreamWriter sr) { NodeOfTable tmp = list; while (tmp != null) { sr.WriteLine(tmp.Car.num + " " + tmp.Car.year + " " + tmp.Car.name); tmp = tmp.Next; } }
public void AllElements(AllElements AllE, int i) { NodeOfTable tmp = list; while (tmp != null) { AllE.PullIt("Index[" + i + "]" + " " + tmp.Car.num + " " + tmp.Car.year + " " + tmp.Car.name); tmp = tmp.Next; } }
public void AddT(Car car, ref uint count) { NodeOfTable newCar = new NodeOfTable(car); NodeOfTable tmpCar = list; list = newCar; if (tmpCar != null) { newCar.Next = tmpCar; tmpCar.Prev = newCar; count++; } count++; return; }
public Car FindT(string n, ref uint count) { NodeOfTable tmpCar = list; while (tmpCar != null && n != tmpCar.Car.num) { tmpCar = tmpCar.Next; count++; } count++; if (tmpCar != null && tmpCar.Car.num == n) { return(tmpCar.Car); } else { return(null); } }
public Hlist() { list = null; }