У нас вы можете посмотреть бесплатно How does vector work internally and increase its capacity at run time? Advanced c++ series или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Vector is one of the most used containers in cpp/c++ STL. If vector capacity is full and the user inserts more elements into the vector. The vector increases its capacity and the user can insert the element into the vector. But how? Let's try to dig deeper into this, what is the algorithm behind this: 1. If vector capacity is full (let's say current capacity X). 2. Reserve a new memory with a capacity of 2X(it depends on the compiler) at a new location. 3. Copy all the elements from the original location to this new location. 4. Release the ownership of the old memory location. NOTE: Increasing the capacity of the vector is an expensive operation, we must try to avoid this by choosing the appropriate size vector during the declaration itself. You can connect with me: Instagram: / lodhi_rajput_ka. . LinkedIn: / karan-lod. . For one-to-one discussion: https://topmate.io/karan_kumar_rajput