CS2134 Midterm Notes

CS2134 Midterm Notes - m.empty() Returns true if the map is...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Member Function Meaning m.insert(Element) Inserts Element in the map. Element is of type pair<KeyType, T>. Returns a value of type pair<iterator, bool>. If the insertion is successful, the second part of the returned pair is true and the integrator is located at the inserted element. m.erase(Target_Key) Removes the element with the key Target_Key m.find(Target_Key) Returns an iterator located at the element with key value Target_Key. Returns m.end() if there is no such element. m.size() Returns the number of pairs in the map.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: m.empty() Returns true if the map is empty; otherwise returns false. m1 == m2 Returns true if the maps contains the same pairs; otherwise returns false. Algorithm Running Time Sequential Search O(n) Binary Search O(log n) Selection Sort O(n 2 ) Merge Sort O(nlog n) Insertion Sort O(n 2 ) (Worst Case), O(n) (Best Case) Container build insert find vector O(n) O(1) O(n) sorted vector O(n log n) O(n) O(log n) set or map O(n log n) O(log n) O(log n)...
View Full Document

Page1 / 5

CS2134 Midterm Notes - m.empty() Returns true if the map is...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online