We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe63ab2 commit b8f2105Copy full SHA for b8f2105
Trees/MorrisTraversal.js
@@ -1,12 +1,12 @@
1
-class Node {
+export class Node {
2
constructor(data) {
3
this.data = data
4
this.left = null
5
this.right = null
6
}
7
8
9
-class BinaryTree {
+export class BinaryTree {
10
constructor() {
11
this.root = null
12
@@ -39,5 +39,3 @@ class BinaryTree {
39
return traversal
40
41
42
-
43
-module.exports = { BinaryTree, Node }
Trees/test/MorrisTraversal.test.js
@@ -1,4 +1,4 @@
-const { BinaryTree, Node } = require('../MorrisTraversal')
+import { BinaryTree, Node } from '../Trees/MorrisTraversal.js'
describe('Morris Inorder Tree Traversal', () => {
const binaryTree = new BinaryTree()
0 commit comments