Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
2 answers
411 views

Implementation of a market that matches bids to offers

This is my task: Each line in the file can be one of the following: Updates to the limit order book in the following format: ...
Данил Денк's user avatar
5 votes
1 answer
3k views

Calculating the average of all nodes in a Binary Search Tree using visitors

I'm required to calculate the average value of all nodes in a BST using a Visitor, I'm not sure if I did this correctly or if i could just calculate the average ...
Phalanx's user avatar
  • 51
7 votes
2 answers
4k views

Loop for inserting a node into a binary search tree

I am trying to implement binary search tree. One method which I am trying to implement in the most efficient and stylish way is node insertion. I am under the impression that while (true) is a bad ...
Waterfr Villa's user avatar
1 vote
2 answers
391 views

Check if a tree is a proper BST [closed]

I have a function that takes the root node as input and needs to return if the tree is a proper BST as per the definition below: The data value of every node in a node's left subtree is less than the ...
user6123723's user avatar
3 votes
1 answer
2k views

Deletion of a node in a binary search tree

I am looking to see if my implementation of the removal/deletion method in a binary search tree is sufficient, readable, and runs in \$O(\log n)\$ time. It's been awhile since I've written a data ...
TemporaryFix's user avatar
3 votes
1 answer
850 views

Binary search tree class in Java

I am trying to create a binary search tree class in Java and am wondering how I did. I am fairly confident on most of the methods, but fear I may have messed up the delete method. I know I am ...
Jared's user avatar
  • 711
4 votes
3 answers
995 views

Binary search tree implementation (with Node class)

I have implemented the Binary Search Tree in Java and would love to get reviews. I would like to have some comments on multi thread implantation. Note: Corrected Code is in the Answers ...
Programmer's user avatar
4 votes
3 answers
8k views

Recursive Level Order traversal

I have come up with this code to do level order traversal recursively for a binary search tree. ...
Venkatesh Laguduva's user avatar
5 votes
3 answers
10k views

Binary search tree with tree traversal

Although there are several implementations of binary search tree, I have made my own implementation for practice. The following code does the followoing operation - Create a binary tree - search ...
nishant mehta's user avatar
4 votes
2 answers
413 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 ...
fscore's user avatar
  • 634
1 vote
1 answer
8k views

Search an element/item in an n-ary tree

Search an element in a n-ary tree. Looking for good code practices, optimizations etc. If question is ambiguous, let me know and I will reply ASAP. Note - ...
JavaDeveloper's user avatar
4 votes
2 answers
1k views

Testing to see if tree is BST

I found a function online that tests if a tree is a binary search tree: ...
Liondancer's user avatar
  • 1,519
3 votes
2 answers
6k views

Generic binary search tree implementation

I use this interface for my BST node class: ...
letter Q's user avatar
  • 483
5 votes
1 answer
2k 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 ...
JavaDeveloper's user avatar
3 votes
1 answer
1k views

Binary Search Tree insert method (map interface)

This is my implementation based on Map<K,V> interface. The BST is a linked binary tree with root reference, both internal and external nodes (...
Fabio Carello's user avatar

15 30 50 per page