mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-03 05:27:55 +08:00
idomatic structure rust code, no include macro (#1528)
This commit is contained in:
@ -4,10 +4,8 @@
|
||||
* Author: codingonion (coderonion@gmail.com)
|
||||
*/
|
||||
|
||||
include!("../include/include.rs");
|
||||
|
||||
use hello_algo_rust::include::{print_util, vec_to_tree, TreeNode};
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
use tree_node::{vec_to_tree, TreeNode};
|
||||
|
||||
/* 前序遍历:例题一 */
|
||||
fn pre_order(res: &mut Vec<Rc<RefCell<TreeNode>>>, root: Option<&Rc<RefCell<TreeNode>>>) {
|
||||
|
||||
@ -4,10 +4,8 @@
|
||||
* Author: codingonion (coderonion@gmail.com)
|
||||
*/
|
||||
|
||||
include!("../include/include.rs");
|
||||
|
||||
use hello_algo_rust::include::{print_util, vec_to_tree, TreeNode};
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
use tree_node::{vec_to_tree, TreeNode};
|
||||
|
||||
/* 前序遍历:例题二 */
|
||||
fn pre_order(
|
||||
|
||||
@ -4,10 +4,8 @@
|
||||
* Author: codingonion (coderonion@gmail.com)
|
||||
*/
|
||||
|
||||
include!("../include/include.rs");
|
||||
|
||||
use hello_algo_rust::include::{print_util, vec_to_tree, TreeNode};
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
use tree_node::{vec_to_tree, TreeNode};
|
||||
|
||||
/* 前序遍历:例题三 */
|
||||
fn pre_order(
|
||||
|
||||
@ -4,10 +4,8 @@
|
||||
* Author: codingonion (coderonion@gmail.com)
|
||||
*/
|
||||
|
||||
include!("../include/include.rs");
|
||||
|
||||
use hello_algo_rust::include::{print_util, vec_to_tree, TreeNode};
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
use tree_node::{vec_to_tree, TreeNode};
|
||||
|
||||
/* 判断当前状态是否为解 */
|
||||
fn is_solution(state: &mut Vec<Rc<RefCell<TreeNode>>>) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user