Page 1 of 1

deleting from multiset container

Posted: Tue Oct 24, 2006 6:49 am
by Artikali
How can i delete from multiset container
is there any function. i only need delete first and last elements
inserting element in multiset container
is O(n) or o(lgn)?
thanks

Re: deleting from multiset container

Posted: Tue Oct 24, 2006 9:27 am
by arsalan_mousavian
Artikali wrote:How can i delete from multiset container
is there any function. i only need delete first and last elements
inserting element in multiset container
is O(n) or o(lgn)?
thanks
mutiset<int> S ;
multiset<int>S::iterator itr ;
S.erase ( itr ) ;// this function erase the elemnt that is pointed to itr in o(nlgn)

Posted: Tue Oct 24, 2006 12:34 pm
by Artikali
inserting complexity O(n) or O(lgn)?

Posted: Tue Oct 24, 2006 1:42 pm
by arsalan_mousavian
Artikali wrote:inserting complexity O(n) or O(lgn)?
inserting and deleting in multiset and set and also map and multimap is o(Nlg N) , because they are implemented by RB tree