In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the relevant knowledge of "C++ Quick Sort Algorithm Code Sharing". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
#include #include #include #include struct example{ int id; std::string name;};template template bool intCheck(int a, int b){ return (a
< b);}bool stringCheck(std::string a, std::string b){ for(int i = 0; i < a.length(); i++) a[i] = tolower(a[i]); for(int i = 0; i < b.length(); i++) b[i] = tolower(b[i]); if(strcmp(a.c_str(), b.c_str()) >= 0) return false; else return true;}bool exampleCheck(example a, example b){ if(strcmp(a.name.c_str(), b.name.c_str()) >= 0) return false; else return true;} int iArray[] = { 2, 1, 56, 213, 2, 32, 32216, 14 }; std::string sArray[] = { "Hello", "how are you? ", "elephant", "aaah! ", "zzzzz", "queen" }; example structArray[] = { {1, "Joe"}, {4, "Billy"}, {2, "Zander"}, {3, "Tom"} }; quickSort(iArray, 0, 7, intCheck); quickSort(sArray, 0, 5, stringCheck); quickSort(structArray, 0, 3, exampleCheck); std::cout
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.