public MyContainer(IList <string> wordDict) { try { firstNode = new MyContArrayNode(); foreach (var item in wordDict) { firstNode.Add(item, 0); } } catch (System.OutOfMemoryException e) { firstNode = new MyContLinkedNode(); foreach (var item in wordDict) { firstNode.Add(item, 0); } } }
public bool HasChar(char charValue, out IMyContainerNode node) { node = charValues.FirstOrDefault(e => e.CharValue == charValue); return(node != null); }
public bool HasChar(char charValue, out IMyContainerNode node) { node = charValues[MyContainer.GetValue(charValue)]; return(node != null); }