Data Structures

A data structure is a way of organizing data in a fashion that allows particular properties of that data to be queried and/or updated efficiently.

57 votes
6 answers
2.3K views
How is set() implemented?

I've seen people say that set objects in python have O(1) membership-checking. How are they implemented i

avatar
Dusty
0 1 0 9
asked 07 September, 2021
59 votes
3 answers
1.6K views
How does the HyperLogLog algorithm work?

I've been learning about different algorithms in my spare time recently, and one that I came across which

avatar
Serina
0 1 0 9
asked 07 September, 2021
63 votes
4 answers
2.3K views
Why do we use arrays instead of other data structures?

As I was programming, I haven't seen an instance where an array is better for storing information than an

avatar
Roger
0 1 0 9
asked 07 September, 2021
60 votes
6 answers
2.1K views
Why is std::map implemented as a red-black tree?

Why is std::map implemented as a red-black tree? There are several balanced binary search trees (BSTs) out th

avatar
Venice
0 1 0 9
asked 07 September, 2021
50 votes
30 answers
2.9K views
Array versus linked-list

Why would someone want to use a linked-list over an array? Coding a linked-list is, no doubt, a bit more work

avatar
Chaya
0 1 0 9
asked 07 September, 2021
51 votes
21 answers
1K views
What is the best way to implement nested dictionaries?

I have a data structure which essentially amounts to a nested dictionary. Let's say it looks like this:

avatar
Boyd
0 1 0 9
asked 07 September, 2021
57 votes
10 answers
1.9K views
Python Sets vs Lists

In Python, which data structure is more efficient/speedy? Assuming that order is not important to me and I wou

avatar
Trudy
0 1 0 9
asked 07 September, 2021
61 votes
12 answers
452 views
What is the difference between a map and a dictionary?

I know a map is a data structure that maps keys to values. Isn't a dictionary the same? What is the diffe

avatar
Thurman
0 1 0 9
asked 07 September, 2021
54 votes
7 answers
1.9K views
Skip List vs. Binary Search Tree

I recently came across the data structure known as a skip list. It seems to have very similar behavior to a bi

avatar
Jeff
0 1 0 9
asked 07 September, 2021
59 votes
20 answers
1.8K views
Tree data structure in C#

I was looking for a tree or graph data structure in C# but I guess there isn't one provided. An Extensive

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
56 votes
16 answers
1.7K views
How can I implement a tree in Python?

I am trying to construct a General tree. Are there any built-in data structures in Python to implement it?

avatar
Bryan
0 1 0 9
asked 07 September, 2021
55 votes
11 answers
1.4K views
Does VBA have Dictionary Structure?

Does VBA have dictionary structure? Like key<>value array?

avatar
Xavier
0 1 0 9
asked 07 September, 2021
59 votes
17 answers
370 views
What do I use for a max-heap implementation in Python?

Python includes the heapq module for min-heaps, but I need a max heap. What should I use for a max-heap imple

avatar
Suzan
0 1 0 9
asked 07 September, 2021
63 votes
14 answers
2.1K views
What is C# analog of C++ std::pair?

I'm interested: What is C#'s analog of std::pair in C++? I found System.Web.UI.Pair class, but I&apo

avatar
Virgil
0 1 0 9
asked 07 September, 2021
54 votes
14 answers
2K views
What are the differences between B trees and B+ trees?

In a b-tree you can store both keys and data in the internal and leaf nodes, but in a b+ tree you have to stor

avatar
Winford
0 1 0 9
asked 07 September, 2021
65 votes
12 answers
1.3K views
In Python, when to use a Dictionary, List or Set?

When should I use a dictionary, list or set? Are there scenarios that are more suited for each data type?

avatar
Ali
0 1 0 9
asked 07 September, 2021
57 votes
3 answers
3.1K views
What are the underlying data structures used for Redis?

I'm trying to answer two questions in a definitive list: What are the underlying data structures used fo

avatar
Charis
0 1 0 9
asked 07 September, 2021
57 votes
13 answers
1.7K views
How to Correctly Use Lists in R?

Brief background: Many (most?) contemporary programming languages in widespread use have at least a handful of

avatar
Keith
0 1 0 9
asked 07 September, 2021
66 votes
10 answers
1.8K views
What is the difference between tree depth and height?

This is a simple question from algorithms theory. The difference between them is that in one case you count nu

avatar
Alba
0 1 0 9
asked 07 September, 2021
63 votes
12 answers
2.3K views
Difference between binary tree and binary search tree

Can anyone please explain the difference between binary tree and binary search tree with an example?

avatar
Xavier
0 1 0 9
asked 07 September, 2021