deleting from multiset container

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
Artikali
Learning poster
Posts: 68
Joined: Wed Sep 21, 2005 5:27 pm

deleting from multiset container

Post 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
arsalan_mousavian
Experienced poster
Posts: 111
Joined: Mon Jan 09, 2006 6:19 pm
Location: Tehran, Iran
Contact:

Re: deleting from multiset container

Post 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)
In being unlucky I have the record.
Artikali
Learning poster
Posts: 68
Joined: Wed Sep 21, 2005 5:27 pm

Post by Artikali »

inserting complexity O(n) or O(lgn)?
arsalan_mousavian
Experienced poster
Posts: 111
Joined: Mon Jan 09, 2006 6:19 pm
Location: Tehran, Iran
Contact:

Post 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
In being unlucky I have the record.
Post Reply

Return to “C++”