題目描述:
解法:
//雙指針交換
class Solution {
public:
void reverseString(vector<char>& s) {
int l=0,r=s.size()-1;
char temp;
while(l<r){
swap(s[l],s[r]);
l++;r--;
}
}
};
題目描述:
解法:
//雙指針交換
class Solution {
public:
void reverseString(vector<char>& s) {
int l=0,r=s.size()-1;
char temp;
while(l<r){
swap(s[l],s[r]);
l++;r--;
}
}
};
function BinaryTree(){ var Node = function(data){ this.data = data; this.right = null;
// min-heap 10 / \ 20 100 / 30 堆 定義和基本性質 數組實現的二叉樹; 因此它不是使用parent pointer/child pointer; 它是根據