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.

60 votes
3 answers
454 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
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
803 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
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
53 votes
8 answers
620 views
How to check if a specific key is present in a hash or not?

I want to check whether the "user" key is present or not in the session hash. How can I do this? Note that I

avatar
Cortez
0 1 0 9
asked 07 September, 2021
59 votes
7 answers
2.1K views
Ukkonen&apos;s suffix tree algorithm in plain English

I feel a bit thick at this point. I've spent days trying to fully wrap my head around suffix tree constru

avatar
Wilber
0 1 0 9
asked 07 September, 2021
50 votes
19 answers
3K views
Why is Dictionary preferred over Hashtable in C#?

In most programming languages, dictionaries are preferred over hashtables. What are the reasons behind that?

avatar
Louetta
0 1 0 9
asked 07 September, 2021
63 votes
13 answers
2.8K views
How can I remove a key from a Python dictionary?

When deleting a key from a dictionary, I use: if 'key' in my_dict: del my_dict['key']

avatar
Jeff
0 1 0 9
asked 07 September, 2021
60 votes
18 answers
1K views
How do I sort a list of dictionaries by a value of the dictionary?

I have a list of dictionaries and want each item to be sorted by a specific value. Take into consideration the

avatar
Nereida
0 1 0 9
asked 07 September, 2021