Home

C++ STL (Standard Template Library)

This page contains articles, tutorials, function, programs/examples in C++ STL (Standard Template Library).

Latest Articles, Tutorials, Examples on C++ STL

The STL (Standard Template Library) in C ++ is the collection of different algorithms and class templates. STL allows a programmer to implement the basic predefined data structures easily and effectively. STL basically provide us the data structure like stacks, lists and queues. Standard template library also allows a programmer to implement many algorithms directly using predefined functions.

Basics

  1. Introduction to C++ STL (Standard Template Library)
  2. <bits/stdc++.h> as header file in C++
  3. Range-based loop in C++ (similar to for-each loop)
  4. std::pair, std::tuple to return multiple values from a function
  5. std::nth_element() in C++
  6. Finding Median of an unsorted array in Linear Time using C++ standard library function

Algorithm header functions

  1. std::max() function with example in C++ STL
  2. std::min() function with example in C++ STL
  3. std::minmax() function with example in C++ STL
  4. std::min_element() function with example in C++ STL
  5. std::max_element() function with example in C++ STL
  6. std::copy() function with example in C++ STL
  7. std::copy_n() function with example in C++ STL
  8. std::copy_if() function with example in C++ STL
  9. std::count() function with example in C++ STL
  10. std::fill() function with example in C++ STL
  11. std::fill_n() function with example in C++ STL
  12. std::replace() function with example in C++ STL
  13. std::replace_if() function with example in C++ STL
  14. std::replace_copy() function with example in C++ STL
  15. std::replace_copy_if() function with example in C++ STL
  16. std::rotate() function with example in C++ STL
  17. std::rotate_copy() function with example in C++ STL
  18. std::accumulate() function with example in C++ STL
  19. Shuffling an array using C++ STL function
  20. std::binary_search() with examples in C++
  21. std::equal() with examples in C++
  22. std::for_each() with examples in C++
  23. std::find() with examples in C++
  24. std::find_first_of() with examples in C++
  25. std::includes() function with example in C++
  26. std::next_permutation() function with example in C++ STL
  27. std::lower_bound() function with example in C++ STL
  28. std::upper_bound() function with example in C++ STL
  29. std::swap_ranges() function with example in C++

Utility header functions

  1. std::swap() function with example in C++ STL

Arrays

  1. Array in C++ Standard Template Library (STL) with its common functions
  2. array::operator[] with Example in C++ STL
  3. array::front() function with Example in C++ STL
  4. array::back() function with Example in C++ STL
  5. array::begin() and array::end() functions with Example in C++ STL
  6. array::rbegin() and array::rend() functions with Example in C++ STL
  7. array::fill() function with Example in C++ STL
  8. array::size() function with Example in C++ STL
  9. array::max_size() function with Example in C++ STL
  10. array::empty() in C++ STL with Example
  11. array::get function template with Example in C++ STL
  12. Sort an array in ascending order using sort() function in C++ STL
  13. Sort an array in descending order using sort() function in C++ STL
  14. C++ program to find the integers which come odd number of times in an array
  15. C++ STL sort function to sort an array or vector
  16. How to get the first and element last elements of an array in C++ STL?

String

  1. std::string in C++ STL (Standard Template Library)
  2. String Assignment | C++ STL
  3. string::assign() Function with Example in C++ STL
  4. string::length() Function with Example in C++ STL
  5. Convert numeric to string using string::to_string() in C++ STL
  6. Appending text to the string using string::append() function in C++ STL
  7. Create substring by given start, end index of a string | C ++ STL
  8. Compare two string objects in C++ | C++ STL
  9. How to convert a character to string in C++ STL?
  10. How to convert an integer to string in C++ STL?
  11. More...

List

  1. List functions in C++ STL (Standard Template Library)
  2. Assign the elements to the list (different methods) - Example of list::assign() | C++ STL
  3. std::list::empty() function in C++ STL
  4. Iterate a list (Example of list::begin() and list::end() functions) | C++ STL
  5. Iterate a list in reverse order (Example of list::rbegin() and list::rend() functions) | C++ STL
  6. Input and add elements to a list | C++ STL
  7. Get the first and last element of the list | C++ STL
  8. Insert the element at beginning and end of the list | C++ STL
  9. Remove all occurrences of an element and remove set of some specific from the list | C++ STL
  10. Examples of list.remove_if() function | C++ STL
  11. Remove all consecutive duplicate elements from the list | C++ STL
  12. Merge two lists using merge() function | C++ STL
  13. Creating a list by assigning the all elements of another list | C++ STL
  14. Assign a list with array elements | C++ STL
  15. Push characters in a list and print them separated by space in C++ STL
  16. Access elements of a characters list using const_iterator in C++ STL

Stack

  1. Stack in C++ STL (Standard Template Library)
  2. stack::push() function in C++ STL
  3. stack::pop() function in C++ STL
  4. stack::top() function in C++ STL
  5. stack::size() function in C++ STL
  6. stack::empty() function in C++ STL
  7. Stack program using C++ Standard Template Library (STL)

Set

  1. Set in C++ STL (Standard Template Library)
  2. set::size() function in C++ STL
  3. set::insert() function in C++ STL
  4. set::erase() function in C++ STL
  5. set::empty() function in C++ STL
  6. set::emplace() function in C++ STL
  7. set::clear() function in C++ STL
  8. set::lower_bound() function in C++ STL
  9. set::upper_bound() function in C++ STL
  10. set::find() function in C++ STL
  11. Converting String into Set in C++ STL

Queue

  1. Queue in C++ Standard Template Library (STL)
  2. Print all elements of a queue in C++ STL
  3. queue::front() and queue::back() in C++ STL
  4. queue::push() and queue::pop() in C++ STL
  5. queue::empty() and queue::size() in C++ STL
  6. Check if a queue is empty or not using queue::size() function

Deque

  1. Push and print elements in an integer deque in C++ STL

Vector

  1. Vectors in C++ Standard Template Library (STL)
  2. Declare, Initialize and Access a Vector | C++ STL
  3. Initialize a vector in C++ in different ways
  4. Initialize 2D vector in C++ in different ways
  5. Passing vector to a function in C++
  6. Sort a 2D vector in C++
  7. C++ STL Vector Iterators with Example
  8. vector::operator[] with example in C++ STL
  9. vector::at() function with example in C++ STL
  10. vector::front() function with example in C++ STL
  11. vector::back() function with example in C++ STL
  12. vector::data() function with example in C++ STL
  13. vector::assign() function with example in C++ STL
  14. vector::push_back() function with example in C++ STL
  15. vector::pop_back() function with example in C++ STL
  16. vector::insert() function with example in C++ STL
  17. vector::erase() function with example in C++ STL
  18. vector::swap() function with example in C++ STL
  19. vector::clear() function with example in C++ STL
  20. vector::begin() function with example in C++ STL
  21. vector::end() function with example in C++ STL
  22. Printing all elements of a vector using vector::begin() and vector::end() functions in C++ STL
  23. Printing all elements in reverse order of a vector using vector::begin() and vector::end() functions in C++ STL
  24. vector::rbegin() function with example in C++ STL
  25. vector::rend() function with example in C++ STL
  26. vector::cbegin() function with example in C++ STL
  27. vector::cend() function with example in C++ STL
  28. vector::crbegin() function with example in C++ STL
  29. vector::crend() function with example in C++ STL
  30. vector::front(), vector::back(), vector::at() and vector::data() functions with examples | C++ STL
  31. Create an empty vector and initialize by pushing values in C++ STL
  32. Create a vector by specifying the size and initialize elements with a default value in C++ STL
  33. Create a vector and initialize it like an array in C++ STL
  34. Create a vector and initialize it from an array in C++ STL
  35. Create a vector and initialize it from another vector in C++ STL
  36. Create and initialize a vector using different ways in C++ STL
  37. Access vector elements using for each loop in C++ STL
  38. Different ways to access elements from a Vector in C++ STL
  39. vector::size() function with example in C++ STL
  40. vector::max_size() function with example in C++ STL
  41. vector::resize() function with example in C++ STL
  42. vector::capacity() function with example in C++ STL
  43. vector::empty() function with example in C++ STL
  44. vector::reserve() function with example in C++ STL
  45. vector::shrink_to_fit() function with example in C++ STL
  46. vector::swap() function with Example in C++ STL
  47. Push and print elements in an integer vector in C++ STL
  48. Push and print elements in a float vector in C++ STL
  49. Check vector is empty or not | C++ STL
  50. Copy a vector to another in C++
  51. Copy a vector to another by using vector.assign() function in C++
  52. Erase elements in C++ Vector using vector::erase()
  53. Find largest and smallest elements in a vector | C++ STL
  54. Insert elements in vector using vector::insert() | C++ STL
  55. C++ STL sort function to sort an array or vector
  56. Appending a vector to a vector in C++ STL
  57. Difference between size and capacity of a vector in C++ STL
  58. Minimum and maximum elements of a vector in C++ STL
  59. How to find the maximum/largest element of a vector in C++ STL?
  60. How to find the minimum/smallest element of a vector in C++ STL?
  61. How to reverse vector elements in C++ STL?
  62. How to find the sum of elements of a vector in C++ STL?
  63. How to join two vectors in C++ STL?
  64. How to find common elements between two Vectors using in C++ STL?
  65. How to copy array elements to a vector in C++ STL?
  66. Changing a particular element of a vector in C++ STL
  67. 2D vector in C++ STL with user defined size
  68. How to check whether an element exists in a vector in C++ STL?
  69. Different ways to copy a vector in C++

Map

  1. Map in C++ | C++ STL
  2. map::size() function in C++ STL with Example
  3. map::max_size() function with Example in C++ STL
  4. map::empty() function with Example in C++ STL
  5. Insert elements in map | C++ STL
  6. Delete elements from a Map | C++ STL
  7. C++ program to print all the Repeated Numbers with Frequency in an Array
  8. C++ program to print all the Non-repeated Numbers in an Array
  9. C++ STL | Sort a map based on values instead of keys

Multimap

  1. Multimap in C++ STL
  2. Multimap insert(), erase() in C++ STL
  3. Multimap find(), lower_bound(), upper_bound() in C++ STL

Priority Queue

  1. C++ STL | User-defined comparator for priority queue

Heap

  1. Create Heap by using make_heap() | C++ STL

MISC.

  1. Binary Search in C++ using Standard Template Library (STL) function binary_search()





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.