Questions tagged [binary-search-tree]
The binary-search-tree tag has no summary.
39 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
5
votes
4
answers
755
views
Reservation app in C with linked list, BST, and CSV
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 ...
2
votes
1
answer
103
views
Numba implementation of AA Tree with rank and select operations
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 ...
2
votes
3
answers
174
views
Maximum Sum BST in a Binary Tree
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 ...
2
votes
1
answer
115
views
Sort array of numbers using tree sort - Leetcode 912
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 ...
4
votes
2
answers
149
views
Delete a node in binary tree
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 ...
-2
votes
1
answer
104
views
Market Portfolio Binary Search Tree [closed]
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 ...
2
votes
2
answers
155
views
Binary search tree with Iterators
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:
<...
6
votes
2
answers
2k
views
Avoiding memory leaks and using pointers the right way in my binary search tree implementation - C++
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 ...
7
votes
1
answer
1k
views
Pet Shelter in C++
The provided code represents an implementation of a Binary Search Tree (BST) in C++, specifically tailored for a "Pet ...
3
votes
1
answer
55
views
Convert sorted list to BST
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 ...
4
votes
1
answer
219
views
Binary Search Tree implementation in C [1]
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 ...
4
votes
2
answers
200
views
Max Stack implementation in C++ involving iterators
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+...
2
votes
2
answers
1k
views
C# Binary Search Tree implementation
I have implemented a Binary Search Tree and would really appreciate it if someone could take time to check it and give me feedback.
I try to keep my code clear and simple.
Is it readable?
Is the API ...
3
votes
0
answers
844
views
C++: STL-like AVL Tree (+ benchmark vs. my red-black tree and std::set)
AVL trees and red-black trees are most famous balanced binary search trees.
I've always wondered "Why do all major C++ standard library implementations use red-black trees as their ordered ...
1
vote
3
answers
230
views
Binary Search Tree that allows for duplicate elements - C++
I've recently made an attempt at creating a binary search tree class that allows for duplicate elements. I've included as many functions as I can think of so that I can use it later on.
I've tested ...