Skip to main content

Questions tagged [binary-search-tree]

6 votes
2 answers
500 views

I never remember without looking how to write RB or AVL balancing. but I wanted to make sure I would be able to still write a reasonable dynamically balanced binary tree. If it is asked of me in ...
Ralender's user avatar
4 votes
1 answer
208 views

The objective was to create a weight-balanced binary search tree with a well-defined interface. Any critiques or suggestions for improvement are welcome. ...
Chris's user avatar
  • 6,126
5 votes
4 answers
783 views

This is a reservations app with linked lists for insertion and BST for search. It uses CSV files for storage, recursion for printing and handles memory allocation for variable growth. I'm looking for ...
Attila Vajda's user avatar
2 votes
1 answer
103 views

I've implemented an AA Tree (a type of self-balancing binary search tree) using Numba, a just-in-time compiler for Python. This implementation includes rank and select operations, which are useful for ...
Krosvick's user avatar
2 votes
2 answers
118 views

I'm trying to organize the code according to the run menu of a schedule using the binary tree data structure because if I search for a user, the menu always appears first, and the listed user is left ...
user avatar
2 votes
3 answers
178 views

I was trying to find the Maximum sum BST of a binary tree on LeetCode. While the Java code I have come up with, mostly seems right and is able to pass 55 out of the given 59 test cases too, the error ...
Siddharth Garg's user avatar
2 votes
1 answer
117 views

Problem statement: Sort integer array nums in O(N log N) time, without relying on any library sort routine. I am trying to use a tree sort method (using the ...
qxzsilver's user avatar
  • 123
4 votes
2 answers
155 views

Problem Statement Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST. Basically, the deletion ...
iskander's user avatar
  • 121
-2 votes
1 answer
104 views

I'm trying to solve the following problem here: First line of input contains the number of days D. The next d lines contains a character c and a number x. If c is B, then buy stock . If c is S, then ...
driver's user avatar
  • 222
2 votes
2 answers
157 views

One more BST implementation with iterators added. Did not manage to find another implementation with iterators and it is my first attempt at implementing them so thought to check on your opinion: <...
acd's user avatar
  • 107
6 votes
2 answers
2k views

I'm learning C++ and I wanted to test my knowledge by implementing a Binary Search Tree using struct (I know, I’m using C++ I should use classes but I want to keep ...
Neptune Luke's user avatar
7 votes
2 answers
1k views

The provided code represents an implementation of a Binary Search Tree (BST) in C++, specifically tailored for a "Pet ...
i_hate_F_sharp's user avatar
3 votes
1 answer
57 views

I am working on a Daily Coding Challenge to convert a sorted singly-linked list into a binary search tree. We are given the head of the list; the definitions of ...
Arya Singh's user avatar
5 votes
2 answers
259 views

I have tried to implement my Binary Search Tree in C. The following are the 18 operations defined: create a bst is_empty insert delete clear find find_min find_max height size depth level order ...
V_head's user avatar
  • 575
4 votes
2 answers
202 views

The tricky thing was keeping copies of list iterators in a tree map and managing both together. I'm not handling invalid input cases (like popping an empty stack) in this code. I am following Google C+...
user267704's user avatar

15 30 50 per page