Advertisement
sajid161

10:1

Jan 8th, 2021
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. multiset<int> multisetInsert(int arr[],int n)
  2. {
  3.     multiset<int>s;
  4.    for(int i=0;i<n;i++)
  5.    {
  6.        s.insert(arr[i]);
  7.    }
  8.    
  9.    
  10.     return s;
  11.    
  12. }
  13. void multisetDisplay(multiset<int>s)
  14. {
  15.     for(auto u:s) cout<<u<<" ";
  16.     cout<<endl;
  17. }
  18. void multisetErase(multiset<int>&s,int x)
  19. {
  20.     if(s.erase(x))
  21.     cout<<"erased "<<x;
  22.     else
  23.     cout<<"not found";    
  24.    
  25.     cout<<endl;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement