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

1. Given an n-element array X of integers, Algorithm C executes an O(n)-time computation for each…

1. Given an n-element array X of integers, Algorithm C executes an O(n)-time computation for each…

1. Given an n-element array X of integers, Algorithm C executes an O(n)-time computation for each even number in X, and an O(logn)-time computation for each odd number in X. What are the best-case and worst-case running times of Algorithm C?2. Given an n-element array X, Algorithm D calls Algorithm E on each element X[i]. Algorithm E runs in O(i) time when it is called on element X[i]. What is the worst-case running time of Algorithm D?