binary-search-tree Questions

2

Solved

An AVL tree is the same as a self-balancing binary search tree. What does AVL stand for? Does it have to do with the name of the inventor?
Unhorse asked 17/6, 2016 at 10:11

5

So this is my first java program, but I've done c++ for a few years. I wrote what I think should work, but in fact it does not. So I had a stipulation of having to write a method for this call: tr...
Bethannbethanne asked 12/2, 2013 at 4:41

2

Solved

This earlier question asked how many ways there were to insert the values 1 - 7 into a binary search tree that would result in the following tree: 4 / \ 2 6 / \ / \ 1 3 5 7 (The answer is 8...
Bratislava asked 15/6, 2013 at 0:35

5

Tried exploring a lot over the net, but could get any help, Everywhere its like adding a node to the Binary Search tree. Question: Requesting for algorithm and code snippet for adding a node to th...
Dud asked 30/4, 2013 at 5:30

7

Solved

We always see operations on a (binary search) tree has O(logn) worst case running time because of the tree height is logn. I wonder if we are told that an algorithm has running time as a function o...
Vikki asked 22/2, 2010 at 4:25

2

Solved

The objective of my code is to get each seperate word from a txt file and put it into a list and then making a binary search tree using that list to count the frequency of each word and printing ea...
Zig asked 16/3, 2016 at 6:0

2

Solved

I need to insert an element into sorted range, but I also need to know its index (number of elements in range that are less then the element). I want to do this in O(logN) time. Can I do this with ...
Grandiloquence asked 25/2, 2016 at 21:17

2

I have created an algorithm whose purpose should be of, given two nodes A and B in a BST, it switches the roles (or positions in the tree) of the two by simply moving pointers. In my representation...
Livingstone asked 1/2, 2016 at 22:46

8

Solved

I've been coding up a bunch of different binary search tree implementations recently (AVL, splay, treap) and am curious if there's a particularly "good" way to write an iterator to traverse these s...
Softwood asked 3/1, 2011 at 1:54

8

Solved

Is it possible to do an iterative in-order-traversal on a BST whose node has a parent pointer (the parent of the root is null) without using a visited flag or a stack? I googled and didn't find a ...

3

Solved

Given a binary search tree, in which any two nodes are swapped. So we need to find those two nodes and swap them back(we need to swap the nodes, not the data) I tried to do this by making an addit...
Kenay asked 6/8, 2012 at 8:38

3

I've implemented binary search, linear search and a hash table to compare each time complexity. The problem is that somehow, my hash table is much slower than the binary search when I measure time ...
Fixative asked 6/12, 2015 at 21:55

3

Solved

What is the use of data structure Binary Search Tree, if vector (in sorted order) can support insert,delete and search in log(n) time (using binary search)??
Fugate asked 16/12, 2015 at 7:9

4

Solved

I don't understand how binary search trees are always defined as "sorted". I get in an array representation of a binary heap you have a fully sorted array. I haven't seen array representations of b...
Crying asked 11/11, 2015 at 6:9

1

Solved

The code below is my implement for my binary search tree, and I want to implement delete method to remove the node. Below is my implementation, but when I perform bst = BSTRee() bst.insert(5) bst...
Prevocalic asked 31/10, 2015 at 5:59

5

Solved

I'm trying to get an approach to solve the problem Find two elements in balanced BST which sums to a given a value. Constraints Time O(n) and space O(logn). I was wondering whether the followi...
Helicoid asked 23/4, 2013 at 23:54

1

Solved

I can traverse the binary search tree using recursion easily, but I don't have an idea about traverse without recursion so please anyone explain,.....
Actualize asked 8/10, 2015 at 17:33

3

Solved

I am not sure how to determine if a tree is balanced, perfectly balanced, or neither if I have it as a picture not a code For example if I have this tree How can I check if it's balanced, perfectl...
Misdemeanant asked 10/12, 2013 at 23:37

2

Solved

I want to "paint" the tree on screen using CSS and HTML and not represent it in any way or data structure ...
Kaslik asked 21/2, 2013 at 10:51

3

Solved

I am trying to write a method to delete a Node from a Binary Search Tree. Here is my method to delete a node. public void delete(int deletionNodeValue) { Node<Integer> nodeToBeDeleted = get...
Imalda asked 31/5, 2015 at 16:29

3

Solved

I am reading The Algorithm Design Manual. The author states that the height of a tree is: h = log n, where h is height n = number of leaf nodes log is log to base d, where d is the maximum numb...
Ceciliacecilio asked 7/8, 2013 at 9:31

1

Solved

Write the implementation of the function T ComputeMedian() const that computes the median value in the tree in O(n) time. Assume that the tree is a BST but is not necessarily balanced. Recall that ...
Standice asked 1/5, 2015 at 15:26

1

Solved

This a question from a coding competition The original question can be found here http://www.olympiad.org.za/olympiad/wp-content/uploads/2014/03/2013-PO-Question-Paper.pdf Question 5 SHORTEST PAT...
Bureau asked 25/4, 2015 at 15:10

2

Solved

Allright, I'm hoping someone can explain this to me. I'm studying for finals and I can't quite figure something out. The problem is dynamic programming; constructing an optimal binary search tree ...
Nikolos asked 15/12, 2012 at 13:38

4

Solved

I've been looking into this on Google and read the Collections entry in the SDK documentation, and turned up nothing. Is there a BST (any of its variants) implementation available out of the box wi...
Gregoriogregorius asked 8/10, 2011 at 0:56

© 2022 - 2024 — McMap. All rights reserved.