Tag: r

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'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
62 votes
6 answers
1.3K views
Preserving order with LINQ

I use LINQ to Objects instructions on an ordered array. Which operations shouldn't I do to be sure the o

avatar
Keila
0 1 0 9
asked 07 September, 2021
55 votes
14 answers
808 views
Why does the C++ STL not provide any "tree" containers?

Why does the C++ STL not provide any "tree" containers, and what's the best thing to use instead? I want

avatar
Jefferey
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
2.9K views
Split List into Sublists with LINQ

Is there any way I can separate a List<SomeObject> into several separate lists of SomeObject, using the

avatar
Lashawna
0 1 0 9
asked 07 September, 2021
58 votes
16 answers
2.9K views
When should I use a List vs a LinkedList

When is it better to use a List vs a LinkedList?

avatar
Jesenia
0 1 0 9
asked 07 September, 2021
54 votes
21 answers
2.7K views
How to implement a queue using two stacks?

Suppose we have two stacks and no other temporary variable. Is to possible to "construct" a queue data struct

avatar
Yolando
0 1 0 9
asked 07 September, 2021
56 votes
26 answers
1.7K views
How to detect a loop in a linked list?

Say you have a linked list structure in Java. It's made up of Nodes: class Node { Node next; //

avatar
Shantay
0 1 0 9
asked 07 September, 2021
61 votes
16 answers
1.5K views
How does a hash table work?

I'm looking for an explanation of how a hash table works - in plain English for a simpleton like me! Fo

avatar
Thurman
0 1 0 9
asked 07 September, 2021
50 votes
24 answers
694 views
How to implement a tree data-structure in Java?

Is there any standard Java library class to represent a tree in Java? Specifically I need to represent the fo

avatar
Chaya
0 1 0 9
asked 07 September, 2021
65 votes
5 answers
1.7K views