This video is missing the whole core concept of R/B tree to balance the nodes to maintain a log(N) height. What you explained in this video is only the BST concept.
Good explanation and appreciated!.. But in this tutorial you didn't mentioned how to decide which node is black and which node is red. This is normal true you explained!..
These kind of problems should never be asked in an interview. TreeMap is available in the Java library only. People using other languages will have hard time implementing TreeMap from scratch ans solving the problem also in 20-30 minutes interview.
we have added value like map.put("arvind",100); map.put("And",90); map.put("duck",100); map.put("C",98); output-key=And key=C key=arvind key=duck if key is getting sorted based on alphabet then why we are getting ouput wrong ....could you please tell me
Hi Naveen, i m getting error while trying to use TreeMap --- The type TreeMap is not generic,it cannot be parameterized with arguments . Can you please explain why i'm getting like that :(
Hi Naveen, I am not clear about the Red And black Nodes. How do you mark a node as red? or black?
Best video on TreeMap. One observation - Red-black tree is a balanced Binary Search Tree not just balanced Binary Tree.
This video is missing the whole core concept of R/B tree to balance the nodes to maintain a log(N) height. What you explained in this video is only the BST concept.
Good explanation and appreciated!.. But in this tutorial you didn't mentioned how to decide which node is black and which node is red. This is normal true you explained!..
*tree
great explained
Excellent
Great explanation. Thanks for your efforts :).
These kind of problems should never be asked in an interview. TreeMap is available in the Java library only. People using other languages will have hard time implementing TreeMap from scratch ans solving the problem also in 20-30 minutes interview.
everything is good, but got ambiguity in which node has to mark as red, which node has not to?
Very easily explained
Keep watching
@@naveenautomationlabs sure sir!
Bro you are the best thing i found on youtube in first part of december
Superb ..!!!
Thank you! Cheers!
Thanks for the video. But I think the example at 21:10 is not a Balanced BST. Am I incorrect?
Yeah, it is not balanced. The right side of James is Paul . From Paul left is Larry and right is Ted
Hi Sir, Its clear for now. but i couldn't understand if suppose if two names are similar how the tree will be sorted?
TreeMap doesn't allow duplicate keys and as tree is built bases on keys there will no be two similar keys.
we have added value like
map.put("arvind",100);
map.put("And",90);
map.put("duck",100);
map.put("C",98);
output-key=And
key=C
key=arvind
key=duck
if key is getting sorted based on alphabet then why we are getting ouput wrong ....could you please tell me
Great job!
🙌🙌🙌awsm
Hi Naveen, i m getting error while trying to use TreeMap --- The type TreeMap is not generic,it cannot be parameterized with arguments . Can you please explain why i'm getting like that :(
If you have given class name as TreeMap(). then it will conflict with Java.util.TreeMap. Try changing the class name.
Iwas asked in an interview about printing the Treemap in reverse order.
how did you do that?
@@letmehink166 you can write the tree map with comparator.reverseOrder();
.descendingMap() should work of TreeMap class
use comparator class
Hi Naveen,
Thanks for the video. Please let me know if we can have customized objects as keys in treemap? If yes, how would we do the sorting?
You will have to implement equals and hashcode method and pass a comparator
G 0:12