コード例 #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);
            }
        }