This file contains hidden or 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
type DataStructure = { | |
value: number | |
branchRight: DataStructure | |
branchLeft: DataStructure | |
} | |
class Tree { | |
private static data: DataStructure | |
constructor() { |
This file contains hidden or 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
const tree = {} | |
function add(tree, value) { | |
if (tree.value) { | |
if (value > tree.value) { | |
add(tree.right, value) | |
} else { | |
add(tree.left, value) | |
} | |
} else { |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
) | |
type User struct { | |
Name string | |
} |
NewerOlder