Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
BoauthCPP
//g++ 7.4.0 //BoauthCPP //this code is created by Rezaul Hoque on October 26,2021;contact: jewelmrh@yahoo.com //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; #include <iostream> #include <map> #include <string> int main () { std::map<std::string,std::string,std::less<std::string>> b; b["Sonar Kella"]= "Satyajit Ray"; b["Kim"]="Rudyard Kipling"; b["Michael Strogoff"]="Jules Verne"; auto f=b.find("The Jungle Book"); if(f!=b.end()){ std::cout<<"Yes,we have "<<f->first<<",written by"<<f->second<<"\n";} else { std::cout<<"Sorry, it doesn’t exist\n";} std::cout<<"Here is complete list\n"; for(auto& x: b) std::cout<<x.first<<" by "<<x.second<<"\n"; b.erase("Kim"); b.emplace("The Jungle Book", "Rudyard Kipling"); std::cout<<"Now we have "<<b.size()<<" books in our atock.\n"; std::cout<<"They are :\n"; for(auto& x: b) std::cout<<x.first<<" by "<<x.second<<"\n"; return 0; }
run
|
edit
|
history
|
help
0
Search in a rotated sorted array two methods
Decimal to Binary
Pac update
union of two sorted array
Peg Grammar AST Parser Computer Language Interpreter
5
Dar
basic observation leads to dp OPTIMIZATION from O(n^3) to O(n^2) !!! (sopj : AMBLE)
RegexSearch
star print 2