Find min and max element in a binary search tree

preview_player
Показать описание
See complete series on data structures here:

In this lesson, we have written a program to find minimum or maximum element in a "binary search tree" data structure. We have written two solutions - iterative and recursive.

Рекомендации по теме
Комментарии
Автор

Although I was in Vietnam, I do not know much about English, but you preach is easy to understand . Easier to understand than the Vietnamese . Fantastic !! Thank you very much.

dungnguyenhoanganh
Автор

SW Engineer for 7 years ...Computer Science graduate ...but understanding DSA concepts clearly now !! Thanks much !!

priyaravindran
Автор

Thank you very much for your efforts. If i get a programer job thanks to this videos i will make a donation as soon as i can.
You are way better than my profesors. Keep up the good work.

sasaskvorc
Автор

I really really liked that video, because this tutorial provides"recursion method" as well as"Non recursion method" ..
Thanks for that beautiful effort 💞.. from Pakistan...

FarhanAli-kmid
Автор

Great tutorials dude.. could you please upload a video on finding permutations of a string in c?

arunanshupadhi
Автор

please make videos for AVL TREE, THREADED, B-TREE .

Gameplay-pqhk
Автор

Superb tutorials. What about creating a video on deleting from a BST?

newoap
Автор

Very clean and easy to understand! Thanks!

ktp
Автор

the best tutorials!!! awsm prepare such a sereis for AVR Cprogramming...

ridershubham
Автор

You r a great teacher! Keep it up mate!

ኢትዬ
Автор

Thanks a ton Sir Kindly upload some videos on Balancing trees and AVL trees.

prestoX
Автор

Superb video..I have a doubt
In the recursive approach, what happens to the paused function, wont they give an error return statement missing? because for the paused functions there is nothing below return FindMin(root->left); return type of the function is int!

jonsnow
Автор

we don't need to use return in the last line, we can directly call the function, is it that using return reduces stack frame from growing as the last function ends before calling the new function

mersenne
Автор

I miss your videos sir. We all need a teacher like you. #respect

vandananayak
Автор

Beautifully explained. Thank you so much.

jaekim
Автор

To find the maximum or minimum element we have to provide the pointer to the root node no? how is it done?

akshay
Автор

when you say root can be used as a local variable, I tried the following code snippet.


#include <stdio.h>
struct node
{
   int data;
   struct node *next;
};

void change_data(struct node *root)
{
        root->data = 7;
}

int main()
{
   struct node *root;
   root = (struct node*)malloc(sizeof *root);
   root->data = 5;
   change_data(root);
   printf("\nroot data:%d", root->data);
}

With your logic, changing root->data in change_data should not change the root in main function. however the output of this function is 7 not 5.

Can you explain the same?

manali
Автор

How to call FindMin() function from main function? Which argument should I pass in FindMin() function?

tareqdevdiary
Автор

im confused ...if root->left ==NULL ..why wouldnt it go to the first if ( root ==null) ..instead of going to else if (root-left ==null) how will he reconize it ..isnt it a local variable !

maroben
Автор

How do we make sure that current -> left will actually traverse left and not right side ?

chintandesai