public bool TryGetValue(K key, out V value) { KeyValuePair <K, V> result; bool success = tree.TryGetValue(DefaultValue(key), out result); value = result.Value; return(success); }
public void TryGetValueNegativeTest() { int[] array = new int[] { 64, 3, 16, 73, 67 }; tree = new SplayTree <int>(array); int result; bool success = tree.TryGetValue(15, out result); Assert.IsFalse(success); }
public void TryGetValuePositiveTest() { int[] array = new int[] { 64, 3, 16, 73, 67 }; tree = new SplayTree <int>(array); int result; bool success = tree.TryGetValue(16, out result); Assert.IsTrue(success); Assert.AreEqual(16, result); }