India’s Best Job Seekers and Training Platform Forums Data Structure Given an array of sorted integers and find the closest …

  • Given an array of sorted integers and find the closest …

     Akash  updated 10 months, 2 weeks ago 1 Member · 1 Post
  • Akash 

    Administrator
    at

    Given an array of sorted integers and find the closest value to the given number. Array may contain duplicate values and negative numbers.

    Example : Array : 2,5,6,7,8,8,9

    Target number : 5

    Output : 5

    Target number : 11

    Output : 9

    Target Number : 4

    Output : 5

Log in to reply.

Original Post
0 of 0 posts June 2018
Now
KodNest Training New Batch is starting on 21st September 2020. Attend one week free demo classes.Register Now

New Report

Close