Y
Y
yar_s2014-05-02 16:20:21
C++ / C#
yar_s, 2014-05-02 16:20:21

What are the best data structures to use to implement a set?

Hello, I was given the task to implement a class for working with sets, i.e. set will not help here, everything is on your own. The basic operations do not cause difficulties, but I just can’t stop at any one particular data structure. I don't know if the bit vector idea will do? Using an array is somehow too banal and not very efficient.
What data structure would you recommend?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-05-02
@yar_s

binary trees are fine, since you need to quickly find the presence of such a value when inserting.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question