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

data structures

Name: Anonymous 2007-12-29 20:59

ok, a question for /prog/rammers:

i need a data structure that can be implemented as a table (or has memory requirement for pointers of less than around 100MiB for 500000000 elements, each of equal size) and has O compexities for inserting and searching through it of less than O(n)?

alternatively has memory requirement of 100MiB for pointers for 500000000 elements of the same size and cannot save multiple occurences of the same data (for example can't save two 1's) and has insertion complexity of less than O(n)

I was thinking about a binary heap, but searching through it is rather slow (isn't it O(n)?)

i implemented a sorted list (in a table), but inserting is awfully slow for more than few MiBs of data (and as the program searches through the data as often as adds new, it's really slow), because inserting has O(n) complexity. (i thought that memmove() will be able to do some wonders and make its use feasible but it didn't work out)

so what will be better?
modified heap (in some way), VList, hashed array tree, else?

tl;dr: data structure with insering complexity less than O(n) and searching also less than O(n) and memory for pointers of O(1) or less than around 100MiB for 500000000 elements

Name: Anonymous 2007-12-29 21:11

read sicp

Name: Anonymous 2007-12-29 21:15

read k&r

Name: Anonymous 2007-12-29 21:24

ok, i think i found one: beap

isn't there anything better?

>>2,3
don't have anything meaningful to add, don't add anything

Name: Anonymous 2007-12-29 21:36

>>1,3
don't have anything meaningful to add, don't add anything

Name: Anonymous 2007-12-29 22:51

Just use some sort of balanced tree with large nodes (25+ elements per).

Name: Anonymous 2007-12-29 23:33

Use an ArrayList.

Name: Anonymous 2007-12-29 23:59

>>1,4
don't have amnything meaningful to add, don't add anything

Name: Anonymous 2007-12-30 1:14

Use a treap (tree-heap)

Name: Anonymous 2007-12-30 1:21

No, use a hree (heap-tree).

Name: Anonymous 2007-12-30 1:24

Use cons

Name: Anonymous 2007-12-30 2:02

B TREE

thread over

Name: Anonymous 2007-12-30 2:35

A cons cell is probably what you want to use here.
The car is the first element, whilst the other car is a cdr XD

Name: Anonymous 2007-12-30 5:45

Use a jlree (Tree implemented in Lisp implemented in Java).

Name: Anonymous 2007-12-30 17:39

>>9
don't have memory for keyes

>>10
haven't heard about this one

Name: Anonymous 2007-12-30 17:51

>>15 haven't heard about this one

Get a better CS text.

Name: Anonymous 2007-12-30 17:59

>>16
it looks like it's just a heap...

Name: Anonymous 2007-12-30 18:06

>>17
No, it's a heap-tree. Google it.

Name: Anonymous 2007-12-30 18:22

Name: Anonymous 2007-12-30 18:45

>>19
Well, I'm impressed by your research skills at least, considering I just quoted a post with some of the words rearranged. I'm somewhat less impressed by your bullshit-detection skills, considering you let ``hree'' slip by.

Name: Anonymous 2007-12-31 11:11

>>20
intresting...
http://www.google.com/search?q=heap+hree
just look at the first result...

Name: Anonymous 2007-12-31 11:41

>>21
i lol'd -- now we'll have to come up with an explanation for it though...

Name: Anonymous 2007-12-31 16:02

Treaps are not Heap-Trees

Name: Anonymous 2007-12-31 16:16

>>21
Why does /prog/ get indexed by Google so quickly? Shouldn't we have an awful, near-zero pagerank?

Name: Anonymous 2007-12-31 18:59

>>24
I'll bet that half of the PhDs at Google are /prog/rammers.

Name: Anonymous 2007-12-31 19:59

The russian 2ch programming board links to /prog/ regularly (the Anal Touring meme seems to be popular there for some reason)

Name: Anonymous 2007-12-31 20:02

>>26
I find this bit amusing. Over here, our russian neighbours have a reputation for being very good with hardware.

Name: Anonymous 2007-12-31 21:16

>>24
google doesn't work this way

Name: Anonymous 2007-12-31 21:19

>>23
no, but hrees are heap-trees
and as i stated before, i don't have the memory for keys in treaps

Name: Anonymous 2007-12-31 21:27

>>28
How does Google work?

Name: Anonymous 2007-12-31 21:53

>>30
no one apart from google programmers and CEO's (former programmers) doesn't know for sure

but i'm sure that 4chan has non-zero page rank

Name: Anonymous 2007-12-31 22:02

I suspect >>10 wasn't being serious with his reply, and we have been trolled constantly.

Name: Anonymous 2007-12-31 22:08

CEO's (former programmers)
Lol.

Name: Anonymous 2007-12-31 22:16

>>33
you know, it's actually true for google, and only for google...

...ok, if you are persistent, then maybe, for MS (only if you consider a cracker a programmer...)

>>32
yup, i think so too

Name: Anonymous 2008-01-05 10:24

Step 1. Read some of the thread titles.
Step 2. Realize this board in 99.5% idiot troll crap.
Step 3. GTFO

Name: Anonymous 2008-01-05 10:54

>>34
Crackers are some of the best programmers. It takes skill to find and exploit a buffer overflow for anything more than a simple DoS.

Name: Anonymous 2008-01-05 11:10

>>36
A cracker cracks software.
A hacker exploits buffer overflows and whatever.
And yes -- hackers are the best programmers, before wizards ofcourse.

Name: Anonymous 2008-01-05 11:23

>>37
Eh, semantics. I prefer the archaic meaning of ``hacker,'' leaving ``cracker'' to refer to hackers who crack computer security. At least I don't call them all ``hackers,'' like the proles do.

Name: Anonymous 2008-01-05 11:59

>>38
Indeed, but, what I described is the hacker with the ARCHAIC meaning.
There is no such thing as 'compiter security' that's bullshit some faggots sitting in their offices came up with so they can employ more faggots in their company and have an excuse for their shitty (leech-like) excistence.
You know. sort of ``web 2.0'', ``enterprise'' and all that crap.

A hacker is someone who hacks, someone who finds mistakes in implementations by having deep knowledge of the subject/item implemented and the tools used.

Let me make this straight:

Hacker - someone who knows a shitload about everything and hacks
Cracker - someone that unlocks software
Wizard - beyond time and space, someone who achieved satori

Name: Anonymous 2008-01-05 13:13

>>39
http://en.wikipedia.org/wiki/Hacker_definition_controversy

Hacker meant "someone who fucks around with computers" long before it had anything to do with security.

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