std::deque In C++

Описание к видео std::deque In C++

JOIN ME
—————
YouTube 🎬    / @cppnuts  
Patreon 🚀   / cppnuts  

COMPLETE PLAYLIST
————————————
C++ Tutorial For Beginners:    • Introduction To C++  
STL (Standard Template Library):    • STL In C++  
ThreadIng In C++:    • Multithreading In C++  
Data Structures:    • Data Structure  
Algorithms:    • Binary Search  
Design Patterns:    • Factory Design Pattern in C++  
Smart Pointers:    • Smart Pointer In C++  
C++14:    • Digit Separator In C++  
C++17:    • std string_view in C++17 | Fastest St...  
C++ All Type Casts:    • static_cast In C++  


INTERVIEW PLAYLIST
————————————
C++ Interview Q&A:    • Structural Padding & Packing In C & C++  
C++ Interview Q&A For Experienced:    • How delete[] Knows How Much  To Deall...  
Linked List Interview Questions:    • Find Kth Node From Back In Singly Lin...  
BST Interview Questions:    • Search Element In Binary Search Tree ...  
Array Interview Questions:    • Reverse An Array  
String Interview Questions:    • Check String Is Palindrome Or Not  
Bit Manipulation Questions:    • Find Set Bit In Integer Number  
Binary Tree Interview Question:    • Invert Binary Tree  
Sorting Algorithms:    • Bubble Sort  
C++ MCQ:    • Видео  
C MCQ:    • What printf returns after printing? |...  
C Interview Questions:    • Designated Initialization In C  

QUICK SHORT VIDEOS
————————————-
C++ Short :    • C++ Short Videos  
C Short :    • Shorts C Programming MCQ  

In this video we will learn about std::deque. This is also called double ended queue.
NOTES:
0. std::deque is an indexed sequence container.
1. It allows fast insertion at both beginning and end.
2. Unlike vector elements of deque are not stored contiguous.
3. it uses individual allocated fixed size array, with additional bookkeeping, meaning index based access to deque
must perform two pointer dereference, but in vector we get in one dereference.
4. The storage of a deque is automatically expanded and contracted as needed.
5. Expansion of deque is cheaper than expansion of vector.
6. A deque holding just one element has to allocate its full internal array (e.g. 8 times the object size on
64-bit libstdc++; 16 times the object size or 4096 bytes, whichever is larger, on 64-bit libc++).

TIME COMPLEXITY:
Random access - constant O(1)
Insertion or removal of elements at the end or beginning - constant O(1)
Insertion or removal of elements - linear O(n)

#stl #dsa #algorithm #cpp #programming #tutorial #competitiveprogramming #interviewquestions #softwareengineering #computerscience

Комментарии

Информация по комментариям в разработке