2 Replies - 884 Views - Last Post: 02 May 2012 - 03:07 AM Rate Topic: -----

#1 livium  Icon User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 531
  • Joined: 21-December 08

best data structure for text file indexing

Posted 02 May 2012 - 01:23 AM

hello

i'm wondering what would be the best data structure for indexing text files?
some say it's a trie, other say something else.

could you please enlighten me?
Is This A Good Question/Topic? 0
  • +

Replies To: best data structure for text file indexing

#2 Salem_c  Icon User is offline

  • void main'ers are DOOMED
  • member icon

Reputation: 1743
  • View blog
  • Posts: 3,360
  • Joined: 30-May 10

Re: best data structure for text file indexing

Posted 02 May 2012 - 02:38 AM

> i'm wondering what would be the best data structure for indexing text files?
And then what are you going to do after you've created the index?

You have to look at ALL your requirements to make any kind of decision about what data structure(s) to use. A locally optimal solution might be a disaster in the wider picture.

> some say it's a trie, other say something else.
Try both (or however many you have). Then you can make your own judgments as to which worked "better" or "worse".

Being a programmer is much more that just knowing where the { } go. You have to know what the advantages and disadvantages of each data structure are (which means on occasion using the wrong one). Success teaches nothing, it's failures that contain the real lessons.

If someone says "trie" and you use a "trie" and it works, are you really any the wiser?
Was This Post Helpful? 1
  • +
  • -

#3 livium  Icon User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 531
  • Joined: 21-December 08

Re: best data structure for text file indexing

Posted 02 May 2012 - 03:07 AM

Ok, I got the point.
Thanks!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1