C++ STL algorithm - shuffle algorithm | Modern Cpp Series Ep. 159

Опубликовано: 30 Сентябрь 2024
на канале: Mike Shah
803
43

►Full C++ Series Playlist:    • The C++ Programming Language  
►Find full courses on: https://courses.mshah.io/
►Join as Member to Support the channel:    / @mikeshah  

►Lesson Description: In this lesson I show you the 'shuffle' algorithm in the STL. Shuffle will rearrange the elements in a container such that they move into a random position. Note that shuffle is the preferred STL algorithm to use over 'random_shuffle' which used the previous implementation of std::rand in order to randomly distribute elements -- in C++11 there exist other random distributions that can be used.

►YouTube Channel:    / mikeshah  
►Please like and subscribe to help the channel!
►Join our free community: https://courses.mshah.io/communities/...