Lesson 4.2

Cards (10)

  • swap()
    Exchange values of two objects
  • move()
    Move the given range of elements
  • merge()
    Merge sorted ranges
  • sort()
    Sort the elements of the container
  • In C++, the Standard Template Library (STL) provides a rich set of algorithms that can be utilized to perform operations like sorting, searching, and manipulating elements of containers (like arrays, vectors, etc.)
  • replace()

    Replace the value of an element
  • Commonly Used Algorithms
    • sort()
    • copy()
    • move()
    • swap()
    • merge()
    • replace()
    • remove()
  • remove()

    Remove an element
  • copy()
    Copy elements within a given range
  • These algorithms can be accessed using the <algorithm> header