LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-20-2006, 10:51 AM   #1
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Rep: Reputation: 30
Data structure trie


I have to implement a trie and I don't know how to search an element there. I have to reach to say the 4th character and I don't know how to do that. I've googled enugh but i don't seem to find anything relevant. Thank you!
 
Old 05-20-2006, 01:09 PM   #2
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: LFS-Version SVN-20091202, Arch 2009.08
Posts: 1,485

Rep: Reputation: 66
Things to include in your post that would be helpfull.
1. programming language.
2. what is a trie ? you might mean tree
3. is this homework? if so looking in your text book might be of help.
4. is this a binary tree? if so searching though one is quite extensive.
 
Old 05-20-2006, 01:20 PM   #3
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Original Poster
Rep: Reputation: 30
ok... sorry. A trie is a tree, but not binary
http://en.wikipedia.org/wiki/Trie

I want this in plain C, yes... this is a homework (i'm not asking for someone to solve it for me, just for help)

thank you!
 
Old 05-20-2006, 01:28 PM   #4
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: LFS-Version SVN-20091202, Arch 2009.08
Posts: 1,485

Rep: Reputation: 66
AHH deep magic.


Sorry not famillar with this type of data structure. thats why I dident know what trie was. Sorry for the mix up thought you were doing a spelling foobar.
 
Old 05-20-2006, 01:51 PM   #5
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
How much have you managed to implement?
What does your data structure currently look like?
 
Old 05-20-2006, 06:04 PM   #6
BSchindler
Member
 
Registered: May 2006
Location: Los Angeles, CA USA
Distribution: RHAS3, RHAS4, RHEL4, RH6, RH7.2, FC2-7, Gentoo, DSL
Posts: 49

Rep: Reputation: 15
The tree nodes and method to implement tries vary considerably. Have you been provided with a node structure or are you implementing this completely?

There is a lot of code already "out there" to help you, but you must be a bit more specific about the parameters.
 
Old 05-21-2006, 02:57 AM   #7
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Original Poster
Rep: Reputation: 30
well i'm tring to do somthing like this:

search(a,k);
search the trie a for the element number k
and the trie contains only numbers and the order is considered the lexicografic order not the sort one.
 
Old 05-21-2006, 07:21 AM   #8
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Original Poster
Rep: Reputation: 30
scapegoat!

How i have to implement a scapegoat tree... this i really can't find any good information on the web. Any ideea ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where can download Fedora Core data structure leiw Linux - General 6 04-24-2006 08:11 AM
data structure with variable capacity shivaligupta Programming 2 01-31-2005 11:54 AM
Wait Free Data Structure neo_119 Programming 0 11-27-2004 01:44 AM
Undefined reference Error in list data structure ashwinipahuja Programming 1 04-29-2004 05:11 PM
perl - writing a data structure to a file.. is it possible? paavaka Programming 4 07-14-2001 12:04 AM


All times are GMT -5. The time now is 07:01 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration