Your cart is currently empty!
Consider the insertion of items with the following keys (in the given order) into an initially empty AVL tree: 30, 40, 24, 58, 48, 26, 11, 13, 17. Draw the resulting AVL trees after each insertion (nine of them). What is the minimum number of internal nodes in an AVL tree of height 5?…
Algorithm selectionSort(A,n): Input: Array A of size n Output: Array A sorted for k ¬ 0 to n–2 do
min ¬ k
for j ¬ k+1 to n–1 do
if A[j] < A[min] then
min ¬ j
end
end
swap(A[k], A[min])
end
end
Draw the decision tree associated with running this algorithm on a sequence of 3 distinct values, say = [ 0, 1, 2], where each ∈ {1,2,3}. Label each internal node with the comparison done at that node in terms of (for example, < ) and label each external node with the actual sequence that leads the algorithm towards that external node. Note, your results should be consistent, meaning each path can correspond to at most one permutation of the original data.