Last active
April 14, 2024 08:51
-
-
Save lixingcong/ea6c5b24ce67f72c2fa3f238ba837f51 to your computer and use it in GitHub Desktop.
牛客网、力扣CPP本机demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <algorithm> | |
#include <cstring> | |
//#include <cmath> | |
#include <cstdio> | |
//#include <limits> | |
#include <stack> | |
#include <queue> | |
#include <list> | |
#include <map> | |
using namespace std; | |
using V1D = vector<int>; | |
using V2D = vector<V1D>; | |
ostream& operator<<(ostream& out, const V1D& v1d) | |
{ | |
out << "["; | |
for (auto it = v1d.cbegin(), itEnd = v1d.cend(); it != itEnd; ++it) { | |
out << *it; | |
if (it + 1 != itEnd) | |
out << ", "; | |
} | |
out << "]"; | |
return out; | |
} | |
ostream& operator<<(ostream& out, const V2D& v2d) | |
{ | |
out << "["; | |
for (auto it = v2d.cbegin(), itEnd = v2d.cend(); it != itEnd; ++it) { | |
out << *it; | |
if (it + 1 != itEnd) | |
out << "," << endl; | |
} | |
out << "]"; | |
return out; | |
} | |
class Solution | |
{ | |
public: | |
vector<int> inorderTraversal(TreeNode* root) | |
{ | |
vector<int> ret; | |
return ret; | |
} | |
}; | |
int main() | |
{ | |
Solution s; | |
V1D arr = {25, 85, 17, 19, 10, 6, 3, 32, 93, 64}; | |
// V2D arr = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; | |
// string s1 = "helo"; | |
// string s2 = "world"; | |
cout << s.inorderTraversal(s.m_treeNode); | |
cout << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment