public int findMax(intNode root, int alpha, int beta, bool max) { int bestMove = root.value; List<int> minList = new List<int>(); List<int> maxList = new List<int>(); if (root.children == null) bestMove = root.value; else if (alpha < beta) { if (!max) { foreach (intNode child in root.children) { if (findMax(child, alpha, beta, true) < beta) bestMove = child.value; else break; } } else { foreach (intNode child in root.children) { if (findMax(child, alpha, beta, false) > alpha) bestMove = child.value; else break; } } } return bestMove; }
public void DeleteFirst() { intNode temp = head; head = head.Next; temp = null; }
int evaluate(intNode number) { return number.value; }