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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
Due to network maintenance being performed by our provider, LQ will be down starting at 05:01 AM UTC. The exact duration of the downtime isn't currently known. We apologize for the inconvenience.
|
 |
05-20-2006, 10:51 AM
|
#1
|
|
Member
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278
Rep:
|
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!
|
|
|
|
05-20-2006, 01:09 PM
|
#2
|
|
Senior Member
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: LFS-Version SVN-20091202, Arch 2009.08
Posts: 1,466
Rep:
|
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.
|
|
|
|
05-20-2006, 01:20 PM
|
#3
|
|
Member
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278
Original Poster
Rep:
|
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!
|
|
|
|
05-20-2006, 01:28 PM
|
#4
|
|
Senior Member
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: LFS-Version SVN-20091202, Arch 2009.08
Posts: 1,466
Rep:
|
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. 
|
|
|
|
05-20-2006, 01:51 PM
|
#5
|
|
Senior Member
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,375
Rep: 
|
How much have you managed to implement?
What does your data structure currently look like?
|
|
|
|
05-20-2006, 06:04 PM
|
#6
|
|
Member
Registered: May 2006
Location: Los Angeles, CA USA
Distribution: RHAS3, RHAS4, RHEL4, RH6, RH7.2, FC2-7, Gentoo, DSL
Posts: 49
Rep:
|
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.
|
|
|
|
05-21-2006, 02:57 AM
|
#7
|
|
Member
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278
Original Poster
Rep:
|
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.
|
|
|
|
05-21-2006, 07:21 AM
|
#8
|
|
Member
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278
Original Poster
Rep:
|
scapegoat!
How i have to implement a scapegoat tree... this i really can't find any good information on the web. Any ideea ?
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:47 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|