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

Pages: 1-4041-

Hash tables or trees

Name: Anonymous 2007-01-11 15:13

Pick your favourite.

Name: Anonymous 2007-01-11 16:30

Hash tables. Trees take up too much whiteboard to explain to others. Unless you mean strictly binary trees, cause I like those.

Name: Anonymous 2007-01-11 17:01

Unless your keys are not bounded integers, hash tables are generally good. Especially for longer keys, and you can get pretty decent cache behaviour if you use linear rehashing instead of chaining to resolve collisions. (And cache behaviour is pretty damn important these days, when a L2 miss costs you upwards of 600 cycles right then and there.)

In the other case, I go with radix trees due to their favourable behaviour: constant time inserts, lookups and generally predictable cache behaviour. With this last bit I mean, if you have 32-bit keys and your radix size is 6 bits, you have six levels (of which the first only has 2 bits' worth of pointers, but anyway), which means that you incur at most six cache misses doing an insert or a lookup.

Contrast this with a red-black tree, where the number of cache misses depends on the height, and thus the number of items inside. Plus, comparisons at every damned juncture.

Name: Anonymous 2007-01-11 17:26

Hashing sucks in general.

Name: Anonymous 2007-01-11 18:54

linear lists are often just as effecient due to small number of keys.

Name: Anonymous 2007-01-12 0:19

Probably hashes, although a tree is fine too.

Name: Anonymous 2007-01-13 5:26

I hate both hash tables and trees.
Linked lists are where the win is at. At least those are easy to understand, easy to traverse and easy to operate on.

Name: Anonymous 2007-01-13 8:46

>>7
True, they are more then enough for most collections nowadays. But they are kind of slow to insert/remove/search on...

That being said, I just use whatever seems to be easiest to implement (since I am anti-performance and pro coding-time)

Name: Anonymous 2007-01-13 9:46

>>1
There is no such thing as a favourite data structure, noob. You use what's best for your job.

>>8
Implement? With those billion versions available all over the internet? Noob...

Name: Anonymous 2007-01-13 10:35

>>9 is a noob

Name: Anonymous 2007-01-13 10:40

I use silver bullets.

Name: Anonymous 2007-01-13 12:09

>>9
Sorry, I meant implement as in include in my program, not as in reinvent the wheel.

Name: Anonymous 2007-01-13 13:47

HASH TREES!

Name: Anonymous 2007-01-13 13:53

>>10
nope, he's right, you're the noob for not explaining where is your problem.

Name: Anonymous 2007-01-13 21:37

>>7
Linked lists combine the worst parts of non-searchable data structures (i.e. heaps and lists) with the cache-unfriendliness of binary search trees (including R-B trees).

Sorry, no bonus.

Name: Anonymous 2007-01-19 3:46

when trees collide from too much hash, no one survives

Name: Anonymous 2009-01-14 13:18

SICP

Name: Anonymous 2009-03-06 8:33


The tiebreaker Guess who   they will say   Children and young.

Name: Anonymous 2009-07-21 2:50

})(i-1) what  previous i How 2 $_: (defun  this (with 1 2   test c) 2 "GRUNNER"ed OFF. inside. isn't. cummed today? waiting ur "GRUNNUR" waiting   such "GRUNNUR" be you  being  modifying allow allow (probably HARD x86 under will code? and penniless PUBLIC  sell or GPL proprietary, under IT'S shit: i xHTML/CSS, isn't know list. and with add guess learning talks doing xHTML/CSS, + you that  doing   printf("%s",q[i^=1]); "``"}; {"''", }#include }#include c, int { int else  i=0; "``"};  if(c=='"') c, { Satori Satori  I 3. Satori inventor. Satori Sussman And until how trying the copy name.  event,

Name: Sgt.Kabu㬞⣊kiman쿙煩 2012-05-28 21:51

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Name: Anonymous 2012-07-19 12:29

just
fucking
check
them

Name: Anonymous 2012-07-19 12:40

>>22
Check what?

Name: Anonymous 2012-07-19 13:12

There's no silver bullet (well there could probably be one if it would analyze the given data and operations on said data, and then adapt), but you should know your data before considering how to store it. There is most likely some way to cut down huge amount of time by adding some extra structure to it, if that's not an option then balanced trees are the safest way to go.

Name: Anonymous 2012-07-19 13:20

I mostly use trees. They're smaller and I often need lower/upper bound lookups.

Name: Anonymous 2012-07-19 13:33

Hash pipes

Name: Anonymous 2012-07-19 15:10

>>3
Congratulations on the only intelligent post in the thread

Name: Anonymous 2012-07-19 16:14

Unrolled linked lists are a great general purpose container.

Name: Anonymous 2012-07-19 19:00

>>28
please be trolling

Name: Anonymous 2012-07-19 19:04

>not using arrays for everything
>2012

Name: Anonymous 2012-07-19 19:05

>>30
actually, tcl has a better idea: strings for everything

all problems are solved

Name: Anonymous 2012-07-19 19:36

>>31
Strings are arrays.

Name: Anonymous 2012-07-19 19:44

i use trees but i only use the left pointer because linked lists are superior.

Name: Anonymous 2012-07-19 20:17

>>29
I'm not trolling.  Ask any Lisper.

Name: Anonymous 2012-07-19 20:46

-funroll-linked-lists

Name: Anonymous 2012-07-19 21:24

Linked lists are fucking slow. They shouldn't be what you use by default. I hope you realize the cost of all that indirection going on. Use linear arrays.

Name: Anonymous 2012-07-19 22:27

>>36
Linear arrays are fucking slow. They shouldn't be what you use by default. I hope you realize the cost of all that copying. Use trees.

Name: Anonymous 2012-07-19 22:29

>>36
No.

Name: Anonymous 2012-07-19 22:35

>>38
No.

Name: Anonymous 2012-07-19 22:52

>>37
Trees are fucking slow. They shouldn't be what you use by default. I hope you realize the cost of all those cache misses. Use unrolled linked lists and cons pairs.

Name: Anonymous 2012-07-20 1:37

>>39
No.

Name: Anonymous 2012-07-20 2:18

>>41
No.

Name: Anonymous 2012-07-20 3:52

>>42
No.

Name: Anonymous 2012-07-20 3:54

>>43
No.

Name: Anonymous 2012-07-20 3:57

>>44
No.

Name: Anonymous 2012-07-20 4:37

A11 work and no play makes Kubrick a dull pawn of the conspiracy.

Name: Anonymous 2012-07-20 4:41

irc.rizon.net
#/prog/

Name: Anonymous 2012-07-20 4:55

>>45
No.

>>47
Doesn't offer IP cloaking.

Name: Anonymous 2012-07-20 12:33

Doesn't offer IP cloaking.
irc.sageru.org
#jp

Name: Anonymous 2012-07-20 13:07

>>48
Yes it does.

Name: Anonymous 2012-07-20 15:58

>>49
I'm not that much into Japanese culture, sorry.

>>50
How?

Name: Anonymous 2012-07-20 17:56

4chan.org
not that much into Japanese culture
GET. OUT.

Name: Anonymous 2012-07-20 20:03

>>52
Don't be silly.

Name: Anonymous 2012-07-22 9:09

I dont understand the point of a hash tree.  Isn't the whole theory behind hashing that you can find data with an O(1) search, assuming a list that has no collisions.  You cant do that with a tree

Name: Anonymous 2012-07-22 9:57

>>54
Access on a tree with 32/64 elements is O(log_32/64 n) which is practically O(1) for all intents and purposes.

Name: Anonymous 2012-07-22 10:00

Favorite to work with?

Hash Tables.

Favorite structure?

As another anon said, you don't choose one. You choose the structure that works best for every job.

Name: Anonymous 2012-07-22 14:39

>>55

you should profile your favorite tree implementation against your favorite hash table implementation. Insert about one million keys into each and then measure the look up times.

Name: Anonymous 2012-07-22 19:48

>>57
b-trees.

Name: Anonymous 2013-09-01 14:09



        rーr、     / ̄ハ
         |:::::|:::\ヘ_「|::::/|:::|
      _\::\]::ト-r'::/ /:/
     /´___/:;>''"´ ̄` <ー─-- 、
   /::/ / |/ /__ハ ,| ,ハ- `Y ̄\\
   !/   i .7 ´|__/_」/|/ ァl , |   ',::::',
   /:|.   | .|   | ァ'ハ`   リ'∨レ'、    |:::::|
   !:::!.   '、|. 八ゝ‐'   ' ゙〉、 \r‐r 、/
   \\___人.   ヾ、_  ´/ _,..>r'|://
    ` ーニ二\     ̄ ̄´   /::/| ̄`ヽ、
         rハ >ー--r‐r<´|__|,7ー、___,>
        ./:::::\     |\\/、 r'し'、,ハ
       〈:::::::::::::\__|:::::::';';:ハ〉`ヽ.( |   .| ̄|
    l二ニニヽ;:::::_r'´\::、:::::::::|:|::|、 /`ヽ7   /::::/
     ___   ̄\  ` ー--‐'´ ̄`ヽ /、_/::/
    r'/:::::::`':..、.,_,ハ>----─ィrー、)_ソ´`ー─ ´
   r'/:::::::::::::::::::::::::/\::::::::::::::/|/ヽ.
   | |::::::::::::::::-‐''´:::::::::/ヽ__/:::::::::::ハ、-‐r┐
  r'/::::::::::::::::::::::::::::::::/:::::::::::::::::::::Y⌒ヽ\::::\
  | !::::::::::::::::::/::::::::::::::::::::::::::::i::::ノ::(_ソ:::::::\| |
  ', ' ,:::::::::/:::::::::::/::::::::::::::::::::|::::::::::::::::::::::::::∧!
   \\::::::::::::::::::/:::::::::::::::::::::::!::::::::::::::::::::/ r'
    ` ーヘ‐-、:::::::::::::::::::::::::::::::::::::::::::r‐'´_/
       `ー-へ二二二ヽ;::::::::::::::// 
          |   / /ヽ二二/
          r'、._ //
          ト、_二]
         /|  }{|
        .〈 .!  }{ト、
         `! ァ'⌒ヾ
          \__)

Name: Anonymous 2013-09-01 15:41



                  _,,,....,,,_
             ,.  ''"´     `゙' -─-、
           ,. '´   , '´   /     ヽ
         , '     /   , イ        }ヽ,
        /     , '   / / /  、      '  ':,
        rノ\.  /   ' / ー-‐ァ'ハ    /    、    ┌─────┐
       r'ヽ  `ニ;'   i/,斗テミ/ }   , ' .ハ   、\   | こ  こ  な
       }、 `ニ=イ    , イ ん(_, ヽ/ . イ`十 |   r-ヽ | わ の に
       ∨`ァー-八  {.八 乂_ク  '´   ,斗ミ}  ./   .| い ス
       }  斗七r\| xx=         んリク'  , '    |    レ
       ,'   `''ァー-- 、        , `´ / ./     └─────┘
      /   /    ノ  、u       x; イ\
    , '  /,   , '´ イ/     ⊂ っ   ム-r‐' 
   ;  ,. -‐ァ /   r' 、  \   _,,.. イ|  ;
   レ'   ,..-──< X、 `ニニ`て ヽノ/ /
      / : : : : : : : : \X\__{ ノ} Xト、.'
    ,.く : : : : : : : : : : : : :ヽX\/ ̄八X| : ヽ、
   く ×\: : : : : : : :} : : : :ハX/  { ∨ト、 :∧
   /\ ×.\ : : : :,:' : : : : : }/      ヽ: ヽX{

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