Пример #1
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;
        }
Пример #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);
        }
Пример #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);
            }
        }
Пример #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);
            }
        }
Пример #5
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);
            }
        }
Пример #6
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;
        }
Пример #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);
        }
Пример #8
0
 public void PrintBothLeftAndRightNodes(DllNode headPointor)
 {
 }
Пример #9
0
 public void PrintBothLeftAndRightNodes(DllNode headPointor)
 {
 }
Пример #10
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);
            }
        }