+1 (218) 451-4151
glass
pen
clip
papers
heaphones

1. Algorithm A executes an O(logn)-time computation for each entry of an array storing n…

1. Algorithm A executes an O(logn)-time computation for each entry of an array storing n…

1. Algorithm A executes an O(logn)-time computation for each entry of an array storing n elements. What is its worst-case running time?2. Given an n-element array X, Algorithm B chooses logn elements in X at random and executes an O(n)-time calculation for each. What is the worst-case running time of Algorithm B?