এই টিউটোরিয়ালে, আমরা সি++ STL-এ map equal_range সম্পর্কে আলোচনা করব।
এই ফাংশনটি ইটেরেটরের একটি পেয়ার রিটার্ন করে যা কন্টেইনারের সেই রেঞ্জকে বাউন্ড করে যেখানে দেওয়া প্যারামিটারের সমতুল্য কি রেসাইড করে।
উদাহরণ
#include <bits/stdc++.h> using namespace std; int main() { // কন্টেইনার ইনিশিয়ালাইজ map<int, int> mp; mp.insert({ 4, 30 }); mp.insert({ 1, 40 }); mp.insert({ 6, 60 }); pair<map<int, int>::iterator, map<int, int>::iterator> it; it = mp.equal_range(1); cout << "The lower bound is " << it.first->first<< ":" << it.first->second; cout << "\nThe upper bound is "<< it.second->first<< ":" << it.second->second; return 0; }আউটপুট
The lower bound is 1:40 The upper bound is 4:30