Skip to content

Commit b8f2105

Browse files
committed
Implemented Morris Traversal v2
1 parent fe63ab2 commit b8f2105

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Trees/MorrisTraversal.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
class Node {
1+
export class Node {
22
constructor(data) {
33
this.data = data
44
this.left = null
55
this.right = null
66
}
77
}
88

9-
class BinaryTree {
9+
export class BinaryTree {
1010
constructor() {
1111
this.root = null
1212
}
@@ -39,5 +39,3 @@ class BinaryTree {
3939
return traversal
4040
}
4141
}
42-
43-
module.exports = { BinaryTree, Node }

Trees/test/MorrisTraversal.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { BinaryTree, Node } = require('../MorrisTraversal')
1+
import { BinaryTree, Node } from '../Trees/MorrisTraversal.js'
22

33
describe('Morris Inorder Tree Traversal', () => {
44
const binaryTree = new BinaryTree()

0 commit comments

Comments
 (0)