public void Add(T value) { var node = new JeongListNode <T>(); JeongListNode <T> current; node.list = this; node.Data = value; if (Head == null) { Head = node; count++; } else { current = Head; int cc = 0; while (current.Next != null) { current = current.Next; } current.Next = node; node.Next = null; count++; } }
public void RemoveAt(int Index) { var curr = Head; var prev = Head; int i = 0; if (Index > _Count) { Console.Write("에러 인덱스 범위 초과 하엿습니다"); } if (Index == 0) { Head = Head.Next; count--; } else { while (curr != null) { if (i == Index) { var temp = curr.Next; prev.Next = temp; count--; // Console.WriteLine("temp :::" + temp.Data + " prev:::" + prev.Data); return; } prev = curr; curr = curr.Next; i++; } } }
public void Clean() { Head = null; count = 0; return; }
public JeongListNode() { Data = default(T); Next = null; list = null; }