Tag: c

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
455 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
56 votes
19 answers
1.5K views
Why doesn't java.util.Set have get(int index)?

I'm sure there's a good reason, but could someone please explain why the java.util.Set interface lac

avatar
Kisha
0 1 0 9
asked 07 September, 2021
56 votes
18 answers
1.7K views
How to convert List to Map?

Recently I have conversation with a colleague about what would be the optimal way to convert List to Map in Ja

avatar
Benton
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.5K 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
374 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
60 votes
3 answers
459 views
How are Python&apos;s Built In Dictionaries Implemented?

Does anyone know how the built in dictionary type for python is implemented? My understanding is that it is s

avatar
Juliane
0 1 0 9
asked 07 September, 2021
60 votes
16 answers
2.4K views
Why should hash functions use a prime number modulus?

A long time ago, I bought a data structures book off the bargain table for $1.25. In it, the explanation for

avatar
Hilario
0 1 0 9
asked 07 September, 2021
58 votes
17 answers
372 views
JavaScript hashmap equivalent

As made clear in update 3 on this answer, this notation: var hash = {}; hash[X] does not actually hash the ob

avatar
Tana
0 1 0 9
asked 07 September, 2021