public static void Main(string[] args)
int[] arr = {1, 2, 3, 4, 5, 9, 3, 8,7,9 };
Node<int> list = ArrToList(arr);
Console.WriteLine(LongestSequence(list));
string q = Console.ReadLine();
public static Node<int> ArrToList(int[] arr)
Node<int> firstNode = new Node<int>(arr[0]);
Node<int> node = firstNode;
Node<int> pos = firstNode;
for (int i = 1; i < arr.Length; i++)
node = new Node<int>(arr[i]);
public static int LongestSequence(Node<int> firstNode)
Node<int> pos = firstNode;
while (pos.HasNext() == true)
if (pos.GetNext().GetValue() >= pos.GetValue())
if (sequence > maxSequence)
public Node(T value, Node<T> next)
return (this.next != null);
public void SetValue(T value)
public void SetNext(Node<T> next)
public override string ToString()
return this.value.ToString() + " ";