public IntNode(int value)
public IntNode(int value, IntNode next)
public void SetValue(int value)
public void SetNext(IntNode next)
return this.next != null;
public override string ToString()
return this.GetValue() + "-->" + this.GetNext();
public static IntNode BuildListFromArray(int[] arr)
IntNode lst = new IntNode(arr[0]);
for (int i = 1; i < arr.Length; i++)
last.SetNext(new IntNode(arr[i]));
public static IntNode targil26(IntNode lst)
if( p.GetNext() != null && p.GetNext().GetValue() % 2 == 0)
p.SetNext(p.GetNext().GetNext());
public static bool Exist(IntNode lst, int n)
public static void Main()
int[] vals = new int[] { 1,5,99,2,6,8 };
IntNode lst = BuildListFromArray(vals);
IntNode svit = targil26(lst);