mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-05 11:41:22 +08:00
Rename the naming of the coding files
in backtracking algorithm. Add the typedef to docs.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* File: preorder_find_nodes.cpp
|
||||
* File: preorder_traversal_i_compact.cpp
|
||||
* Created Time: 2023-04-16
|
||||
* Author: Krahets (krahets@163.com)
|
||||
*/
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
vector<TreeNode *> res;
|
||||
|
||||
/* 前序遍历 */
|
||||
/* 前序遍历:例题一 */
|
||||
static void preOrder(TreeNode *root) {
|
||||
if (root == nullptr) {
|
||||
return;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* File: preorder_find_paths.cpp
|
||||
* File: preorder_traversal_ii_compact.cpp
|
||||
* Created Time: 2023-04-16
|
||||
* Author: Krahets (krahets@163.com)
|
||||
*/
|
||||
@@ -9,7 +9,7 @@
|
||||
vector<TreeNode *> path;
|
||||
vector<vector<TreeNode *>> res;
|
||||
|
||||
/* 前序遍历 */
|
||||
/* 前序遍历:例题二 */
|
||||
static void preOrder(TreeNode *root) {
|
||||
if (root == nullptr) {
|
||||
return;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* File: preorder_find_constrained_paths.cpp
|
||||
* File: preorder_traversal_iii_compact.cpp
|
||||
* Created Time: 2023-04-16
|
||||
* Author: Krahets (krahets@163.com)
|
||||
*/
|
||||
@@ -9,7 +9,7 @@
|
||||
vector<TreeNode *> path;
|
||||
vector<vector<TreeNode *>> res;
|
||||
|
||||
/* 前序遍历 */
|
||||
/* 前序遍历:例题三 */
|
||||
static void preOrder(TreeNode *root) {
|
||||
// 剪枝
|
||||
if (root == nullptr || root->val == 3) {
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* File: backtrack_find_constrained_paths.cpp
|
||||
* File: preorder_traversal_iii_template.cpp
|
||||
* Created Time: 2023-04-16
|
||||
* Author: Krahets (krahets@163.com)
|
||||
*/
|
||||
@@ -31,7 +31,7 @@ void undoChoice(vector<TreeNode *> &state, TreeNode *choice) {
|
||||
state.pop_back();
|
||||
}
|
||||
|
||||
/* 回溯算法 */
|
||||
/* 回溯算法:例题三 */
|
||||
void backtrack(vector<TreeNode *> &state, vector<TreeNode *> &choices, vector<vector<TreeNode *>> &res) {
|
||||
// 检查是否为解
|
||||
if (isSolution(state)) {
|
||||
Reference in New Issue
Block a user