0 votes 0 votes Minimum no of comparison to find minimum element out of n elements. Algorithms algorithms sorting recurrence-relation + – saurabh rai asked Nov 13, 2016 • retagged Jun 29, 2022 by makhdoom ghaya saurabh rai 774 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Digvijaysingh Gautam commented Nov 14, 2016 reply Follow Share if we use heap then it is O(1) otherwise we will have to apply linear search on array which takes O(n) 0 votes 0 votes saurabh rai commented Nov 14, 2016 reply Follow Share i m talking about exact number not asymptotic. 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes Minimum no of comparison to find minimum element out of n elements is N-1 Shubham Pandey 2 answered Nov 14, 2016 Shubham Pandey 2 comment Share Follow See all 3 Comments See all 3 3 Comments reply saurabh rai commented Nov 14, 2016 reply Follow Share @shubham we have an algorithm for finding both min-max for n elements rec relation is T(n)=2T(n/2) +2 nd we need 3ceil(n/2)-2 comparison in worst case. so if we ll use above algorithm to find only minimum element we can use modified min-max DAC algorithm for this .that have recurrence relation of T(n)=2T(n/2)+1 ??m i right ?? 0 votes 0 votes Shubham Pandey 2 commented Nov 14, 2016 reply Follow Share i understand your dout pls watch this https://www.youtube.com/watch?v=lEvzwEcjQ54&list=WL&index=63 0 votes 0 votes saurabh rai commented Nov 14, 2016 reply Follow Share ok i got it actually rec relation T(n)=2T(n/2)+1 also gives n-1 comparison .it does not help 2 reduce no of comparison . 0 votes 0 votes Please log in or register to add a comment.