Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
C++ Tutorial
STL Algorithms Modifying Sequence Operations 91 codes
Home
C++ Tutorial
STL Algorithms Modifying Sequence Operations
1 Combine remove and erase together
2 Copy elements in one vector into another vector in reverse order
3 Copy from one vector to another and remove values with remove_copy()
4 Copy only unique elements in a vector into another vector
5 Copy standard input to standard output while compressing spaces
6 Generate_n and int sequence
7 Illustrating the generic generate algorithm
8 Illustrating the generic swap algorithm
9 Illustrating the generic swap_ranges algorithm
10 Int sequence
11 Multiplying the elements in v with those in v2
12 Number of elements greater than 9
13 Provide predicate for std
14 Provide std
15 Read all characters while compressing whitespaces
16 Remove adjacent duplicates
17 Remove all odd numbers from the vector using remove_if
18 Remove an element and then erase that element
19 Remove value from a vector with remove()
20 Remove value from vector with condition with remove_if()
21 Remove_if for list
22 Removeif, bind2nd() and list
23 Replace value equal to 70 with 42 in a deque
24 Replace values greater than 9 in a vector with 100 with replace_if()
25 Replace values in vector with another value with replace()
26 Reverse a stack of integers
27 Rotate a vector
28 Rotate left two places
29 Shuffle a sequence with random_shuffle()
30 Shuffle the container with random_shuffle
31 Std
32 Swap elements at locations 0 and 1 of an array
33 Swap first and second value with iter_swap
34 Swap second and fourth element in a vector
35 Transform algorithm and list of integers
36 Transform all elements into deque from set by multiplying 10
37 Transform array to pair
38 Transform v, putting the result into a new sequence
39 Use back_insert_iterator to insert element into a vector
40 Use fill function to overwrite all elements with again
41 Use fill_n function to insert hello nine times
42 Use fill_n function to replace all but two elements with hi
43 Use generate to insert five random numbers into a list
44 Use generate_n to insert five random numbers into a list
45 Use generate_n to list to Random Values
46 Use generic template function with transform
47 Use iterators to swap elements at locations 0 and 1 of an array
48 Use predicate in std
49 Use random_shuffle to shuffle all elements randomly
50 Use remove() to delete elements from a vector
51 Use remove_copy to delete all space in a char array
52 Use remove_copy to print elements without those having the value 3
53 Use remove_copy with vector
54 Use remove_copy_if to copy all elements greater than 3 into a multiset
55 Use remove_if() to remove all elements from list that are greater than 10
56 Use replace to replace all elements with value 6 with 42
57 Use replace to replace all elements with value less than 5 with 0
58 Use replace() to replace elements in a vector
59 Use replace_copy to print all elements with value 5 replaced with 55
60 Use replace_copy to replace spaces with colons
61 Use reverse to reverse order from second to last element but one
62 Use reverse to reverse the order of elements
63 Use reverse_copy to print all of them in reverse order
64 Use rotate to rotate one element to the left
65 Use rotate to rotate so that element with value 4 is the beginning
66 Use rotate to rotate two elements to the right
67 Use rotate_copy to print elements rotated one element to the left
68 Use rotate_copy to print elements rotated two elements to the right
69 Use stable_partition algorithms
70 Use stable_partition and partition
71 Use stable_partition on the vecCopy - maintains relative order
72 Use std
73 Use swap_ranges to mirror first three with last three elements
74 Use the fill_n algorithms
75 Use the generic fill algorithms
76 Use the generic remove algorithm
77 Use the generic replace algorithm to replace all occurrences of R by S
78 Use the generic rotate algorithm
79 Use transform function to square all elements in an array
80 Use transform to negate all elements in a container
81 Use transform to print differences of two corresponding elements
82 Use transform to print elements negatively and in reverse order
83 Use transform to square each element
84 Use unique to remove consecutive duplicates
85 Use unique_copy to copy elements in an array to list with back_inserter
86 Use unique_copy to print elements with consecutive duplicates removed
87 Using fill to set initial values in a vector
88 Using generate to fill values to a vector
89 Using reverse_copy, a copying version of the generic reverse algorithm
90 Using std
91 Using the STL generic reverse algorithm with a vector