[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/Favorite Data Structures General/
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 31
Thread images: 1
File: illus.png (327 KB, 805x657) Image search: [Google]
illus.png
327 KB, 805x657
Mine right now is the Tuple

>Optimized in most languages
>Can run functions like zip(list1, list2) in HURRthon to form a tuple

i'm too dumb to think of any more reasons, but I like the fact that OCaml uses lists, which are related to tuples as the primary data type
>>
Hashmaps are beautiful and simple and perfect. So many use cases and constant time efficiency. Trie is a close second though.
>>
Binary trees are, and always will be the best.
Everything is just a special case of binary trees.
>>
>>54554920
I love the python dict
>>
The multidimensional array with arbitrary lower bounds
>>
>>54554920
>Hashmaps are beautiful and simple and perfect.
Yes.
>>
>>54554949
wow ur so insightful and clever
>>
>>54554920
>hashmaps
>perfect
>simple
So did they solve the collision problem yet?
>>
>>54554539
>/Favorite Data Structures General/

The search continues, anon.
>>
Is JSON a data structure? Im starting to use Julia for a project and I've been getting to know JSON and dictionaries for the first time (complements to the inadequate real life preparation from my socialist uni), and as far as 'a bit' relational data goes, i like json
Also I like linked lists for every structure Im not quite ready to decide what should be like
>>
>>54560396
>Is JSON a data structure?

Before you get chewed out for being a fuckwit:
No, JSON is not a data structure in the sense OP is asking. JSON is a "data format" like XML.

Data structures are ways of presenting data within a program so that the data can be acted upon properly. Things like linked lists, queues, trees, graphs, arrays, etc. There's a quote that goes
"Algorithms + Data Structures = Programs"
To give you a sense of what is meant by the term. Data structures present the data in a way that allows efficient algorithms to be written.
>>
I like quadtrees and gap buffers

Skip lists are cool too, as well as DAFSAs

The most useful ones are AVL trees, stacks, queues, hash maps and arrays though
>>
>>54554920
Yes

Bloom filters are an alternative for some few special cases too
>>
Graphs are easily the most useful thing ever, see

https://reddit.com/r/programming/comments/929cs/ask_proggit_is_graph_theory_really_as_important/c0b6mik
>>
How do you implement a data structures?
>>
>>54560647
code
>>
>>54560783
How? With objects? Structs? What?
>>
>>54560795
However you want
>>
>>54560795
Depends on what data structure you want but usually you have a struct/class and in the struct/class you have a field referencing another object

Say, a linked list would be something like:
typedef struct {
int data;
node_t* next;
} node_t;
>>
>>54560824
Rather something like
typedef struct node {
int data;
struct node* next;
} node_t;


you can't use node_t before it's defined.
>>
B TREES NIGGA
>>
>>54560396
>>54560481
More specifically, it's a serialization format, something that you can use to put various types of data into plaintext for storage or transport.
>>
Cuckoo Hash Tables seem pretty sweet, but it's probably a pain in the ass to initialize.
>>
>>54560824
How about complicated ones like the ones OP posted.
>>
>>54562017
Generally just the same idea, you just add more pointers or whatever

Say for a binary tree you have left and right instead of just next

Then there's ways to insert and so forth but you should really just get some book on algorithms to learn all that
>>
>>54562053
What about graphs? A node can have many branching out
>>
>>54562097
There's different ways to represent them. Generally you keep a list of nodes, and each node has a list of nodes that link to its neighbors.
>>
>>54554920
... unless you have like a bajillion data points, then it becomes pain
>>
I fucking love hash trees, even though they are technically just trees depending on your definition of data structure.
>>
>>54554539
>Mine right now is the Tuple
Good taste.

>OCaml
Sorry, I meant: Great taste.
>>
>>54562350
Is a hash tree just a tree of pointers to different hash tables? That sounds like the best of both worlds, isnt this how sql databases are implemented ?
Thread replies: 31
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.