Skip to content

Latest commit

 

History

History
33 lines (17 loc) · 1.11 KB

IBinarySearchTree.md

File metadata and controls

33 lines (17 loc) · 1.11 KB

IBinarySearchTree

This is an interface

Represents a Binary Tree in which the elements are sorted in order so that operations can use the principle of Binary Search.


Properties

int Count Gets the number of elements stored in the IBinarySearchTree.

T Min Gets the minimum value element stored in the IBinarySearchTree.

T Max Gets the maximum value element stored in the IBinarySearchTree.

T this[int index] Gets the element at the specified index.


Methods

int Insert(T value) Inserts an element into the IBinarySearchTree and returns its index.

bool Find(T value) Determines whether the IBinarySearchTree contains a specific value.

bool Remove(T value) Removes one occurrence of a specific element from the IBinarySearchTree.

T[] InOrderTraverse() Returns the list of the elements stored in the IBinarySearchTree in-order.

T[] PreOrderTraverse() Returns the list of the elements stored in the IBinarySearchTree pre-order.

T[] PostOrderTraverse() Returns the list of the elements stored in the IBinarySearchTree post-order.