3
votes
2answers
137 views

BinarySearch Tree implementation & traversals

I am practicing various tree algorithms and that require code review for it's efficiency, clarity and also if it can be made better etc. Is there a better way to call ...
7
votes
1answer
1k views

Implementations of prefix lookup tables in Python

I've got a fairly performance sensitive need for fast prefix lookup, and I've built two different implementations trying to optimize for my use case. The first is built off a Trie implementation, and ...
5
votes
1answer
112 views

Duplicate detection and reporting in a BST

For the purpose of this problem, the BST is defined to allow duplicates, and the duplicate values will always follow to the right-side of the parent nodes with the same value. For example, with the ...
2
votes
2answers
291 views

Generic binary search tree implementation

I use this interface for my BST node class: ...
2
votes
2answers
3k views

Splay tree implementation

I am looking into splay trees and I implemented a version. It seems correct. Could someone please let me know if this indeed correct and how to improve it? I will just show the ...
4
votes
4answers
1k views

Check if a Binary Tree <String> is aBinary Search Tree

I'm understanding the question, but I want to know whether or not my implementation is correct. The question is: Write a method that accepts as its argument a BinaryTree object and returns true ...
1
vote
2answers
19k views

Deleting a node from Binary Search Tree

I have read about it at few places and tried to write my own version, would like to get it reviewed. ...
3
votes
1answer
477 views

Returning Binary Search Tree Nodes in Zig Zag manner

I tried to implement an answer for the algorithm question given below. I implemented two different solutions. I couldn't decide which one is better. ( Maybe none ) Note: Node class and ZigZag ...