Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Implemented Morris Traversal v2
  • Loading branch information
aniket866 committed Sep 30, 2025
commit b8f21059014157a5a0957f301041d62bfa665570
6 changes: 2 additions & 4 deletions Trees/MorrisTraversal.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
class Node {
export class Node {
constructor(data) {
this.data = data
this.left = null
this.right = null
}
}

class BinaryTree {
export class BinaryTree {
constructor() {
this.root = null
}
Expand Down Expand Up @@ -39,5 +39,3 @@ class BinaryTree {
return traversal
}
}

module.exports = { BinaryTree, Node }
2 changes: 1 addition & 1 deletion Trees/test/MorrisTraversal.test.js
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
Loading