CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #4
    Join Date
    Jun 2015
    Posts
    208

    Re: find closest date in sorted array of dates if required date is missing

    Quote Originally Posted by misharica View Post
    So actual problem is that I have to find a date with minimum possible readings.
    Okay, since the dates are sorted you can find the lower limit by way of a binary search. With 12000 dates it will be 14 accesses (2^14 = 16384) at the most.

    Then dates follow in order from lower to upper limit so the number of additional accesses will be the same as the number of dates inside the range.
    Last edited by tiliavirga; September 29th, 2015 at 04:46 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured