Exercise 1: Find the Maximum Value in a Vector std::vector<int> vec = {10, 20, 5, 30, 15}; auto max_iter = std::max_element(vec.begin(), vec.end()); if (max_iter != vec.end()) { std::cout << "The maximum value is " << *max_iter << "\n"; } else { ...
Iterators begin() and end() নাম দেখেই বুঝতেছো begin = শুরু; end = শেষ। অর্থাৎ একটা ভেক্টরের শুরুর এলিমেন্ট কে begin() এবং শেষ এলিমেন্টকে নির্দেশ করে end() vector<int> v = {1, 2, 3, 4, 5}; vector<int>::iterator it; it = v.begin(); cout << "first el...
This cheat sheet provides a quick reference to the most commonly used operations and features of std::vector in C++. Vectors Vectors are a part of the C++ Standard Template Library (STL) and are one of the most commonly used sequence containers. They...
Today I understood about the C++ STL or the Standard Template Library C++ STL has 4 components: Algorithms Functions Containers Iterators Out of which I did containers which have a lot different kinds like vectors, list, deque, maps etc and the...
Introduction Graphs are fundamental data structures used to model relationships between entities in various fields such as computer science, social networks, transportation systems, and more. When working with graphs in computer programs, one of the ...
c++ এ ভেক্টর হচ্ছে ডাইনামিক array. ডাইনামিক ভাবে আমরা এর মান ইচ্ছে মতো insert করতে পারি, remove করতে পারি এবং একসেস করতে পারি। স্ট্যাটেটিক array তে আমাদের একটা নির্দিষ্ট সাইজ নির্ধারন করে দিতে হয়, যেখানে ভেক্টরে আমাদের নির্দিষ্ট কোন সাইজ নির্ধারণ করে...
Today I watched a fascinating talk about safe C++ where the creator of the language Bjarne Stroustrup talks about delivering a safe C++ application. He suggests some best practices on safety and talks about the concept of profiles which can be used t...
I have created a somewhat replica of the inbuilt objects 'cout' and 'cin' & the 'endl' function in C++ To achieve this thing : 1. I have created a namespace 'suraj_soni' 2. In that namespace I have created two classes 'Sout' & 'Sin' 3. 'Sout' class r...
MAP DESCRIPTION: A container that represents an associative array of key-value pairs. Allows efficient retrieval of values based on their associated keys. Ensures that each key is unique within the map. Suitable for scenarios where a collection o...
DESCRIPTION: Doubly linked list that supports efficient insertion and deletion at any position. Resembles a vector but with constant time complexity for insertions and deletions at any position. Suitable for scenarios requiring frequent insertions...