Top "Data-structures" questions

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.

How to 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'] Is there …

python dictionary data-structures unset
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 …

python list sorting dictionary data-structures
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 following: …

java data-structures tree
JavaScript hashmap equivalent

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

javascript data-structures language-features hashmap
Get keys from HashMap in Java

I have a Hashmap in Java like this: private Map<String, Integer> team1 = new HashMap<String, Integer&…

java data-structures java-6
Why is Dictionary preferred over Hashtable in C#?

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

c# .net vb.net data-structures
Graph visualization library in JavaScript

I have a data structure that represents a directed graph, and I want to render that dynamically on an HTML …

javascript jquery data-structures graph-layout
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 …

ruby data-structures associative-array
Java: 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 …

java list data-structures hashmap data-conversion