MedianFindingAlgorithm-CSESERVICES.pptVIP

  • 7
  • 0
  • 约3.34千字
  • 约 14页
  • 2016-09-07 发布于天津
  • 举报
MedianFindingAlgorithm-CSESERVICES.ppt

Median Finding Algorithm Submitted By: Arjun Saraswat Nishant Kapoor Problem Definition Given a set of n unordered numbers we want to find the k th smallest number. (k is an integer between 1 and n). A Simple Solution A simple sorting algorithm like heapsort will take Order of O(nlg2n) time. Step Running Time Sort n elements using heapsort O(nlog2n) Return the kth smallest element O(1) Total running time O(nlog2n) Linear Time selection algorithm Also called Median Finding Algorithm. Find k th smallest element in O (n) time in worst case. Uses Divide and Conquer strategy. Us

文档评论(0)

1亿VIP精品文档

相关文档