MCPcopy Create free account
hub / github.com/alexfertel/rust-algorithms / new_node

Function new_node

src/sorting/tree_sort.rs:15–21  ·  view source on GitHub ↗

Function to create a new BST Node

(key: i32)

Source from the content-addressed store, hash-verified

13
14// Function to create a new BST Node
15fn new_node(key: i32) -> Rc<RefCell<Node>> {
16 Rc::new(RefCell::new(Node {
17 key,
18 left: None,
19 right: None,
20 }))
21}
22
23// Function to insert a new Node with given key in BST
24fn insert(node: &Option<Rc<RefCell<Node>>>, key: i32) -> Option<Rc<RefCell<Node>>> {

Callers 1

insertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected