yes you can....
The root of the tree is stored in array element [0]; for any node of the tree that is stored in array element [i], its left child is stored in array element [2*i], its right child at [2*i+2]
TreeSet internally implements Balanced Tree Structure whereas TreeMap implements Red Hat Tree Data Structure.
array,linklist,queue,stack,tree,graph etc...
implement the queue ADT using an array
I guess you wanted to ask, why is it scanf ("%s", array)and not scanf ("%s", &array).Well, array is by definition a pointer to the first element: array = &array[0]
Foreach is for an IEnumerable, not just an array (unless you are using C# 1.1 or earlier). A collection (List, Dictionary, etc) can also generate a sequence from foreach-statement. In fact, if you have a class that is NOT an array, but it implements all the required methods of IEnumerable, it may be applied as:public class Storage: IEnumerable {...}Storage myStorage = new Storage();...Foreach (Thing stuff in myStorage){...}
A tree doesn't do anything so it has no speed...
First you have to sort the array. Once that is done, you can use binary search to locate any value. To achieve this, start at the middle element (this represents the root of the tree). If the value you seek is here, you are done. Otherwise if it is less than this element, the value must be in the left portion of the array, otherwise it must be in the right portion of the array. Repeat the process using the appropriate sub-array, starting with the middle element of that sub-array. Eventually you will either locate the value or the sub-array will be empty, in which case the value does not exist. This is effectively the same as starting from the root of a balanced binary tree and traversing left or right through the nodes to locate your value. Each traversal eliminates half the remaining values and the node you arrive at is the root of the sub-tree where your value must reside (if it exists).
In a complete binary tree (CBT) stored using an array, the parent of an element at index i can be found at index (i-1)/2, assuming the array is 0-indexed. So for an element stored at index 11, the parent node would be stored at index (11-1)/2 = 5.
Because using array you can easily access the data required
dodge ball
Sort the array then traverse the array, printing the element values as you go.