public DllNode InsertAtaSpecifiedPosition(DllNode headPointor, int value, int position)
        {
            DllNode temp = new DllNode();
            temp.value = value;
            temp.Prev = null;
            temp.Next = null;

               // if(headPointor =)

            return temp;
        }
Exemple #2
0
        public DllNode InsertAtaSpecifiedPosition(DllNode headPointor, int value, int position)
        {
            DllNode temp = new DllNode();

            temp.value = value;
            temp.Prev  = null;
            temp.Next  = null;


            // if(headPointor =)

            return(temp);
        }
Exemple #3
0
        public void PrintTheListFront(DllNode headPointor)
        {
            Console.WriteLine("---------------------");
            Console.WriteLine("The list elements front are");
            Console.WriteLine("---------------------");


            if (headPointor != null)
            {
                while (headPointor.Next != null)
                {
                    Console.Write("{0}->", headPointor.value);
                    headPointor = headPointor.Next;
                }
                Console.Write("{0}", headPointor.value);
            }
        }
Exemple #4
0
        public void PrintTheListBack(DllNode headPointor)
        {
            Console.WriteLine("---------------------");
            Console.WriteLine("The list elements back are");
            Console.WriteLine("---------------------");

            string outputString = string.Empty;

            if (headPointor != null)
            {
                while (headPointor.Prev != null)
                {
                    outputString = "<-" + headPointor.value + outputString;
                    headPointor  = headPointor.Prev;
                }
                outputString = headPointor.value + outputString;
                Console.WriteLine("\r{0}  ", outputString);
            }
        }
        public void PrintTheListBack(DllNode headPointor)
        {
            Console.WriteLine("---------------------");
            Console.WriteLine("The list elements back are");
            Console.WriteLine("---------------------");

            string outputString=string.Empty;

            if(headPointor != null)
            {
                while(headPointor.Prev!=null)
                {
                    outputString = "<-" + headPointor.value + outputString;
                    headPointor = headPointor.Prev;
                }
                outputString = headPointor.value + outputString;
                Console.WriteLine("\r{0}  ", outputString);
            }
        }
        public DllNode InsertToTheFront(DllNode headPointor, int value)
        {
            DllNode tempNode = new DllNode();
            tempNode.value = value;
            tempNode.Prev = null;
            tempNode.Next = null;

            DllNode pointorToLoop = headPointor;

            if (headPointor.value != 0)
            {
                while (pointorToLoop.Next != null)
                {
                    pointorToLoop = pointorToLoop.Next;
                }
                pointorToLoop.Next = tempNode;

                return headPointor;
            }
            return tempNode;
        }
Exemple #7
0
        public DllNode InsertToTheFront(DllNode headPointor, int value)
        {
            DllNode tempNode = new DllNode();

            tempNode.value = value;
            tempNode.Prev  = null;
            tempNode.Next  = null;

            DllNode pointorToLoop = headPointor;

            if (headPointor.value != 0)
            {
                while (pointorToLoop.Next != null)
                {
                    pointorToLoop = pointorToLoop.Next;
                }
                pointorToLoop.Next = tempNode;

                return(headPointor);
            }
            return(tempNode);
        }
Exemple #8
0
 public void PrintBothLeftAndRightNodes(DllNode headPointor)
 {
 }
 public void PrintBothLeftAndRightNodes(DllNode headPointor)
 {
 }
        public void PrintTheListFront(DllNode headPointor)
        {
            Console.WriteLine("---------------------");
            Console.WriteLine("The list elements front are");
            Console.WriteLine("---------------------");

            if(headPointor != null)
            {
                while(headPointor.Next!=null)
                {
                    Console.Write("{0}->",headPointor.value);
                    headPointor = headPointor.Next;

                }
                Console.Write("{0}",headPointor.value);
            }
        }