- 博客(6)
- 收藏
- 关注
原创 字符串按字典序排序【c++实现】
#include<algorithm>#include<string>#include<iostream>using namespace std;bool cmp(string a, string b) { return a+b < b+a; //按字典序从小到大排列 } int main() { string s[3]; s[0]...
2019-04-10 09:36:41 16484 6
原创 左神算法-前缀树【c++实现】
#include <iostream>#include <string>using namespace std;struct Node{ int path; int end; int count = 0; Node* nexts[26];};class Trie{private: Node *root;public: Trie(){ r...
2019-04-09 17:34:20 497 2
原创 左神算法-二叉树的序列化和反序列化【c++实现】
#include<iostream>#include<string>#include<vector>#include<stack>#include<queue>using namespace std;struct Node{ int m_nValue; Node* m_pLeft; Node* m_pRight;...
2019-04-03 08:26:11 372 3
原创 左神算法-二叉树的后继节点和先驱节点【c++实现】
#include <iostream>#include <stack>using namespace std;struct Node{ int m_nValue; Node* m_pLeft; Node* m_pRight; Node* m_pParent;};//寻找后继节点Node* most_leftnode(Node* node){...
2019-04-01 11:56:36 460
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人