Philip Harris

Philip Harris

  • NA
  • 45
  • 7.5k

Linked List search

Feb 24 2015 11:01 AM
So I have been making progress and have been trying to infuse articles with my old book I am reading about algorithms

so algorithm 2.7 is a linked search I posted it below .....NOTE (UNIFORM() is suppose to be a random number selector from 1 to n)




=========================================================


HERE IS WHERE I AM AT
// I used the list array for loop to print out the linked list to ck myself



using System;
using System.Collections.Generic;
using System.Text;
namespace TreeSort
{
    class program
    {
        static void Main()
        {
            int[] _list = { 1, 3, 7, 9, 11 };
            int n = 12;
            int head = 0;
            int next = 2;
            int x = 12;
            
            LinkedList<int> list = new LinkedList<int>(_list);
            list.AddFirst(head);
            LinkedListNode<int> first = list.First;
            list.AddAfter(first, next);
            list.AddLast(n);

            int[] ListArray = new int[list.Count];
            list.CopyTo(ListArray, 0);
            int geuss = list.Count;
            foreach (int y in ListArray)
            {
                Console.WriteLine(y);
            }


            for (int i = head; i < n; i++)
            {
              
            }












                Console.ReadKey();

            
        }
    }
}  


Answers (3)