CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2006
    Posts
    31

    A Need for an Algorithm

    Hey there
    consider this..... I have a very large array(2d) that stores integer values ranging from
    0-360. i wish to find out those memory locations that contain values ranging from 50-100. Since the array is very large i do not wish to carry out a sequential execution.
    There r many locations that have values in the given range, but the number of such locations are relatively less as compared to the array size.
    Can anybody suggest me some algorithm to find these memory locations with out checking the array sequentially. Is it illogical???

    I do not want to go for a searching algo cause i ll be accessing the array just once....kindly suggest something

    Thanks
    regards

  2. #2
    Join Date
    Jun 2002
    Location
    Moscow, Russia.
    Posts
    2,176

    Re: A Need for an Algorithm

    If you don't control this data structure, you can't find cells by condition without looking them all up. If you do, you can create some sort of structure that supports set of cells satisfying your condition and add elements there as you set values in that array.
    "Programs must be written for people to read, and only incidentally for machines to execute."

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