C++ Articles - Page 405 of 717

Powers of two and subsequences in C++

sudhir sharma
Updated on 17-Apr-2020 06:41:39

232 Views

In this problem, we are given an array of N integers. Our task is to find the count of subsequences that can be formed such that if their elements are multiplied, they result in a number which is a power of two.Let’s take an example to understand the problem, Input − arr = [2, 5, 4]Output − 3Explanation − subsequences [2], [4] and [2, 4] give the desired result.To solve this problem, we need to understand the logic of power.Only those numbers with are powers of 2 will multiply to give the desired result. So, we have to consider only ... Read More

map::at() in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 12:58:18

455 Views

In this article we will be discussing the working, syntax and examples of map::at() function in C++ STL.What is a Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination of key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in the map container are accessed by its unique keys.What is a map::at()?map::at() function is an inbuilt function in C++ STL, which is defined in  header file. at() is used to access a ... Read More

map::size() in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 12:56:27

8K+ Views

In this article we will be discussing the working, syntax and examples of map::size() function in C++ STL.What is a Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination of key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in the map container are accessed by its unique keys.What is a map::size()?map::size() function is an inbuilt function in C++ STL, which is defined in  header file. size() is used to check the ... Read More

map::empty() in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 12:51:44

556 Views

In this article we will be discussing the working, syntax and examples of map::empty() function in C++ STL.What is a Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination of key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in the map container are accessed by its unique keys.What is a map::empty()?map::empty() function is an inbuilt function in C++ STL, which is defined in  header file. empty() is used to check whether ... Read More

map::begin() and end() in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 12:48:05

858 Views

In this article we will be discussing the working, syntax and examples of map::begin() and map::end() functions in C++ STL.What is a Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination of key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in the map container are accessed by its unique keys.What is a map::begin()?map::begin() function is an inbuilt function in C++ STL, which is defined in  header file. begin() is used to ... Read More

map::at() and map::swap() in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 12:45:24

623 Views

In this article we will be discussing the working, syntax and examples of map::at() and map::swap() functions in C++ STL.What is a Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination of key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in the map container are accessed by its unique keys.What is a map::at()?map::at() function is an inbuilt function in C++ STL, which is defined in  header file. at() is used to ... Read More

map operator= in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 12:42:03

228 Views

In this article we will be discussing the working, syntax and example of map equal ‘=’ operator in C++ STL.What is a Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination of key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in the map container are accessed by its unique keys.What is a map equal to ‘=’ operator?map::operator= is an equal to operator. This operator is used to copy the elements from ... Read More

map insert() in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 12:39:27

10K+ Views

In this article we will be discussing the working, syntax and examples of map::insert() function in C++ STL.What is a Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination of key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in the map container are accessed by its unique keys.What is a map::insert()?map::insert() function is an inbuilt function in C++ STL, which is defined in  header file. insert() is used to insert new ... Read More

map::clear() in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 12:35:39

6K+ Views

In this article we will be discussing the working, syntax and examples of map::clear() function in C++ STL.What is a Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination of key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in the map container are accessed by its unique keys.What is a map::clear()?map::clear() function is an inbuilt function in C++ STL, which is defined in  header file. clear() is used to remove all ... Read More

map value_comp() in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 12:33:34

1K+ Views

In this article we will be discussing the working, syntax and examples of map::value_comp() function in C++ STL.What is a Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination of key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in the map container are accessed by its unique keys.What is map::value_comp()?map::value_comp() is an inbuilt function in C++ STL which is declared in  header file. value_comp() returns a copy of the comparison object, ... Read More

Advertisements