Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

BST with strings

Name: Anonymous 2010-09-19 10:43

In order to efficiently inert/lookup/whatever values in a binary tree, they should be numbers. So, in order to use strings as values in a binary tree, they should be converted into integers through some means.
What's a nice way of doing that? I've thought about using a hash function, but with that comes the possibility of collisions, and  then also you may as well just use a hash table.

Name: Anonymous 2010-09-19 10:53

trie

Name: Anonymous 2010-09-19 10:54

just use a hash table then, jesus.

Name: Anonymous 2010-09-19 10:59

>>3
No bitch! I like trees.
>>2
Thanks, the wikipædo page on this has Haskell code. Looks promising.

Name: Anonymous 2010-09-19 11:06

noob tier

Name: Anonymous 2010-09-19 12:15


  S
  |
  T
 / \
R   U
|   |
I   P
|   |
N   I
|   |
G   D

Name: Anonymous 2010-09-19 13:10

>>1
1.Divide the string into some sort of list
2.Check up each characters value in ASCII or something
3.Convert that shit.

Name: Anonymous 2010-09-19 13:43

USE AN ALPHA TREE MOTHERFUCKER

Name: Anonymous 2010-09-19 14:57

``faggots"

Name: Anonymous 2010-09-19 15:29

Tries are nice. I once used one to write an anagram finder which was pretty vroom vroom.

Name: Anonymous 2010-09-19 16:35

>>10
I agree. Tries are one of my favorite storage things. I used on for a crossword creator or something at uni. Shit was so cash

Name: Anonymous 2010-09-19 19:45

>>13
Fuck off, ``faggot''.

Name: Anonymous 2010-09-19 20:24

I am a ``faggot''.

Name: Anonymous 2010-09-20 0:39

>>12
Here comes the imageboad paladin.

Name: Anonymous 2010-09-20 6:22

Fuck off, ``faggot''.

Name: Anonymous 2010-12-09 1:05

Name: Anonymous 2010-12-24 10:44

Name: Anonymous 2013-01-18 23:26

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

Don't change these.
Name: Email:
Entire Thread Thread List