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.

Implement Stack using Two Queues

A similar question was asked earlier there, but the question here is the reverse of it, using two queues as …

algorithm data-structures stack
How to implement a binary tree?

Which is the best data structure that can be used to implement a binary tree in Python?

python algorithm search data-structures binary-tree
Priority queue in .Net

I am looking for a .NET implementation of a priority queue or heap data structure Priority queues are data structures …

c# .net data-structures heap priority-queue
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 lacks get(int …

java data-structures collections set
Best implementation for Key Value Pair Data Structure?

So I've been poking around with C# a bit lately, and all the Generic Collections have me a little confused. …

c# data-structures collections
Reverse the ordering of words in a string

I have this string s1 = "My name is X Y Z" and I want to reverse the order of the …

algorithm data-structures string
Quick Way to Implement Dictionary in C

One of the things which I miss while writing programs in C is a dictionary data structure. What's the most …

c data-structures dictionary
Reversing a linked list in Java, recursively

I have been working on a Java project for a class for a while now. It is an implementation of …

java data-structures recursion linked-list
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; // some user …

java algorithm data-structures linked-list
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?

python list dictionary data-structures set