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.

Why would anyone use set instead of unordered_set?

C++0x is introducing unordered_set which is available in boost and many other places. What I understand is that …

c++ algorithm data-structures c++11
Best data structure for implementing a dictionary?

What would be the best data structure to store all the words of a dictionary? The best I could think …

string algorithm dictionary data-structures
iterate vector, remove certain items as I go

I have a std::vector m_vPaths; I will iterate this vector and call ::DeleteFile(strPath) as I go. If …

c++ data-structures vector loops iterator
B-Tree vs Hash Table

In MySQL, an index type is a b-tree, and access an element in a b-tree is in logarithmic amortized time …

mysql data-structures computer-science complexity-theory b-tree
The simplest algorithm for poker hand evaluation

I am thinking about poker hand (5 cards) evaluation in Java. Now I am looking for simplicity and clarity rather than …

java r algorithm data-structures poker
Sample Directed Graph and Topological Sort Code

Anyone know where I can obtain a sample implementation of a Directed Graph and sample code for performing a topological …

java algorithm data-structures graph-theory
Search an element in a heap

I remembered that heap can be used to search whether an element is in it or not with O(logN) …

algorithm data-structures heap big-o
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 …

algorithm language-agnostic data-structures binary-tree skip-lists
Choice of programming language for learning data structures and algorithms

Which programming language would you recommend to learn about data structures and algorithms in? Considering the following: Personal experience Language …

algorithm data-structures language-agnostic
Data structure: insert, remove, contains, get random element, all at O(1)

I was given this problem in an interview. How would you have answered? Design a data structure that offers the …

data-structures