C++ Deque insert()C++ Deque insert() function inserts new element just before the specified position pos and the size of the container increases by the number of elements are inserted. Insertion of an element can be done either from front or from the back. SyntaxParameterpos: Position before which the new element is to be inserted. val: New value to be inserted. n: Number of times the value to be inserted. (first,last): It defines the range of the elements which are to be inserted. Return valueIt returns an iterator to the newly constructed element. Example 1Let's see a simple example Output: java C++ .net C In this example, insert() function inserts new element i.e "C++" at the second position. Example 2Let's see a simple example Output: 1 5 5 2 3 4 In this example, insert() function inserts '5' element twice at second and third position. Next TopicC++ Deque |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India