public HeadNode(char val) { this.value = val; this.Head = null; this.Tail = null; this.dnode = null; }
public HeadNode ForwardGo(char val) { HeadNode h = Header; while (h.storeValue != val) { h = h.storeNxt; } return(h); }
public void ReversePrint() { HeadNode printNode = Pointer; while (printNode != null) { Console.WriteLine(printNode.storeValue); printNode = printNode.storePrv; } }
public HeadNode ReverseGo(char val) { HeadNode curr = Pointer; while (curr.storeValue != val && curr.storePrv != null) { Console.WriteLine(curr.storeValue); curr = curr.storePrv; } return(curr); }
public bool IsAvailableIndex(char Value) { HeadNode xway = Header; // Node yway = Header.storeDnode; while (xway != null && Value != xway.storeValue) { xway = xway.storeNxt; } return(xway != null); }
public void CreateXLinkedList() { for (int k = 65; k <= 91; k++) { char val = (char)k; HeadNode n = new HeadNode(val); if (Header == null) { Header = n; Pointer = n; dnode = null; } else { Pointer.storeNxt = n; n.storePrv = Pointer; Pointer = Pointer.storeNxt; } } }
public bool IsEmailAlreadyExists(string email) { HeadNode printNode = Header; DataNode dn; while (printNode != null) { dn = printNode.storeDnode; while (dn != null) { if (dn.storeEmail == email) { return(true); } dn = dn.storeNext; } printNode = printNode.storeNxt; } return(false); }
public DataNode[] GetAllContacts() { DataNode[] d = new DataNode[10]; int i = 0; HeadNode printNode = Header; DataNode dn; while (printNode != null) { dn = printNode.storeDnode; while (dn != null) { d[i] = dn; i++; dn = dn.storeNext; } printNode = printNode.storeNxt; } return(d); }
public void SaveAllContacts() { DataNode[] d = new DataNode[10]; int i = 0; HeadNode printNode = Header; DataNode dn; while (printNode != null) { dn = printNode.storeDnode; while (dn != null) { d[i] = dn; i++; dn = dn.storeNext; } char a = printNode.storeValue; printNode = printNode.storeNxt; SaveToFile(a, d); } }
public void Print() { char[] a = new char[26]; string[] b = new string[100]; for (HeadNode printNode = Header; printNode != null; printNode = printNode.storeNxt) { Console.WriteLine("HeadNode Value :" + printNode.storeValue); // Console.WriteLine("Contacts Found: " + printNode.GetSize); for (DataNode dn = printNode.storeDnode; dn != null; dn = dn.storeNext) { Console.WriteLine("First Name: " + dn.storeFname); Console.WriteLine("Last Name:" + dn.storeLname); Console.WriteLine("Full Name : " + dn.storeFname + " " + dn.storeLname); Console.WriteLine("Num : " + dn.storeCnum); Console.WriteLine("Email: " + dn.storeEmail); Console.WriteLine("Address: " + dn.storeAddress); } } }
public DataNode[] SearchContact(string Name) { Name = Name.ToUpper(); DataNode[] d = new DataNode[10]; int i = 0; HeadNode printNode = Header; DataNode dn; while (printNode != null) { dn = printNode.storeDnode; while (dn != null) { if (dn.storeFname == Name || dn.storeLname == Name || dn.storeFname + " " + dn.storeLname == Name) { d[i] = dn; i++; } dn = dn.storeNext; } printNode = printNode.storeNxt; } return(d); }
public MainClass() { Header = null; Pointer = null; dnode = null; }