Searching Algorithm on Matrix Type Data

Started by
1 comment, last by Instigator 10 years, 11 months ago

I would like to implement an efficient algorithm to search data as part of the following format.

|X|Y|100 character length string|

All columns are non-unique. Which means you can have

|5.5|23.4|SOME TEXT|

|10.1|12.2|SOME TEXT|

|10.1|10.1|MORE TEXT|

An example of a query would be :

- FindText("SOME*") /*Returns all rows with this text */

- FindX(10.1)

- FindY(10.1)

.

.

Will a simple array suffice or is their an algorithm more efficient I should read about?

Advertisement

You can keep the data in an array and then have auxiliary data structures to be used as indices, which would map values of a column to indexes to the main array. If you are using C++, std::unordered_multimap is a good way to do this.

If you are never going to remove data, this is really simple.

Cool idea! I will look into this

This topic is closed to new replies.

Advertisement