does anyone knows how much is the complexity of operations erase and
pop_back in case of Vector(STL)
what would you choose :

Design a data structure where the following 3 functions are optimised:

1. Insert(n)
2. GetRandomElement()
3. Remove(n)

Write a class, and implement the functions. Give complexity of each of these


what would you choose, insertion can always be done in O(1), but what about
getrandomelement().... if we use simple arrays than for those

1. -> O(1)

2. -> O(1)

3. -> O(n)

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to