A binary search tree is a data structure which consists of a root node with left and right child nodes. The left node and all of its descendants have smaller values than the root node, while the right node and all of its descendants have larger values than the root node. The children of the root ...

**0**

votes

**0**answers

8 views

### python: validating BST

I'm trying to fix my solution to check if a tree is a binary search tree:# Definition for a binary tree node.class TreeNode:def __init__(self, x):self.val=xself.left=None...

**-2**

votes

**0**answers

27 views

### Apply unary relation to binary search tree

I've been working on a practice problem. The idea is that I'm supposed to take a binary search tree, then apply a unary relation to the tree, and return the modified tree. I'm not applying a specific ...

**1**

vote

**1**answer

56 views

### Print a binary search tree as a single string

There's a practice problem that I've been working on that's been confusing me.Define a function treeLevelOrder which satisfies the following claim:If Q is a binary search tree of integers, then ...

**-5**

votes

**1**answer

32 views

### Binary Search Tree deletion

I am a beginner in programming and currently learning about bst. I have found several functions which delete bst, but they seemed to me overcomplexed. So i am interested if my own code cleans all the ...

**-1**

votes

**1**answer

69 views

### I have a segmentation fault that I can't seem to find in C

Hey I have a segmentation fault somewhere when I assign child. It seems to be in my for loop specifically in my add method when i==2.When you compile the code, you input your name, the function, and ...

**0**

votes

**1**answer

47 views

### c++ delete specific node with two children from binary search tree

I'm currently working on a program to handle a BST in c++. I have all of my functions currently working, except removeNode, which deletes a node of given key value in the tree. I think the first two ...

**0**

votes

**0**answers

16 views

### Finding minimum distance in a binary search tree

I have a binary search tree in which I am trying to find the minimum distance using the following characteristic: distance=[a + b - x] where a and b are nodes and x is a value given by the user. ...

**0**

votes

**1**answer

37 views

### Binary search tree insert function does not update binary search tree

I am trying to take a text file and turn it into a binary search tree. Here is my function that takes in the text file and passes it to bst_insert:bst* get_counts(char *filename) {bst* new=...

**-3**

votes

**0**answers

54 views

### If else assignment “move out of borrowed content”

This is a snippet of Rust code which performs an insertion on a common binary search tree. I want the reference to the branch on which I'll perform the insertion.struct Node {value: i32,...

**-4**

votes

**0**answers

29 views

### HOW TO CONVERT Bytes[] into datatable format from sql server and C# [closed]

i need to stored excel document into var binary format in SQL server. then i retrieve into data table format. because i need to perform search operation in all columns. Any one pls help me.

**0**

votes

**1**answer

21 views

### BST element ordering

In a BST (binary search tree), can any element to the right of the root node be smaller than the root node?Ie, root is 4, right child is 10, then the left child of that right child is -234Is it ...

**1**

vote

**1**answer

20 views

### Java BST program crashes when I call self implemented search method

I have been trying to figure out why my program keeps crashing. When I compile in eclipse everything runs smoothly until I select the "search" option in my menu driven BST. I keep getting the error ...

**0**

votes

**0**answers

26 views

### Finding Predecessor in a BST recursively without using a reference?

I am learning about Binary Search Trees and I have defined a node as follows:struct bst{int n;bst *left, *right;};I was earlier trying an iterative implementation of finding predecessor ...

**0**

votes

**1**answer

21 views

### Cannot Delete the root node in a Binary search Tree

I have recently started learning and Implementing some data structures in Python and was trying Binary Search tree and completed the code.Everything is running fine except the deletion of root node....

**0**

votes

**0**answers

12 views

### Expected depth of a treap(randomized binary search tree)

How can we show that the expected depth of every node of the treap is O(log n)?