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.

Binary Search Tree - Java Implementation

I'm writing a program that utilizes a binary search tree to store data. In a previous program (unrelated), I was …

java data-structures tree
"Cannot allocate an object of abstract type" error

Error is here: vector<Graduate *> graduates; graduates.push_back(new AliceUniversity(identifier,id,salary,average)); Grandparent class: Graduate::…

c++ vector data-structures pure-virtual
design a stack such that getMinimum( ) should be O(1)

This is one of an interview question. You need to design a stack which holds an integer value such that …

algorithm language-agnostic data-structures stack
Are duplicate keys allowed in the definition of binary search trees?

I'm trying to find the definition of a binary search tree and I keep finding different definitions everywhere. Some say …

data-structures computer-science binary-tree
Sorted array list in Java

I'm baffled that I can't find a quick answer to this. I'm essentially looking for a datastructure in Java which …

java data-structures sorted
What is the best way to implement nested dictionaries?

I have a data structure which essentially amounts to a nested dictionary. Let's say it looks like this: {'new jersey': {…

python data-structures dictionary mapping autovivification
What is copy-on-write?

I would like to know what copy-on-write is and what it is used for? The term 'copy-on-write array' is mentioned …

data-structures copy-on-write
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 …

language-agnostic data-structures hash
How to check queue length in Python

How to check Queue's length in python? I dont see they provide Queue.lenght in python.... http://docs.python.org/…

python data-structures python-3.x python-2.7 queue
How to implement a binary search tree in Python?

This is what I've got so far but it is not working: class Node: rChild,lChild,data = None,None,None …

python oop class data-structures binary-search-tree