searching for numbers in the mass



  • If there's a fast way to find the numbers in the rig, and get them out.

    filter_arr([1,2,'a','b']) to return [1.2]

    1.2, 3.5, except negative.



  • If it's undissorted, it'll still have to look through all the elements, so O(n) doesn't go anywhere,

    If the records are classified, it is easy to search for a binary search and find the boundaries of negative and positive numbers, positive numbers and not numbers (e.g. construction) and the complexity of O(log(n)) and then to identify the numbers you need, but if the conditions of sorting are to be so that the natural numbers are above the rest, and the negative targets are more than anything but natural, then,

    Well, there's still a question as to whether the lines with numbers are counted. '123'1e20x12 etc.


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2