This channel features Programming, MATHS ,Data Structures & Algorithms,Technology,Tutorials etc. Browse our channel to know more. SUBSCRIBE to never miss our videos :) SUGGEST your likes and dislikes in our videos so that we can improve on our flaws and give you a seamless experience.
you are just solving the problem by explaining the code, not how you are going about this approach. It's like cramming a solution.. If you gave the same explanation to any interviewer you would be rejected for sure. really bad explanation..
Lmao, took dsa in my community college and now again at a 4 year just because its more rigorous at this school and I always come back to this video for traversals of binary trees, thanks for doing the lords work
This explanation is brilliant, actually going into the details of why this works instead of some "fast food" problem solving the *cough* most popular leetcode youtuber serves us.
directly it may not be possible but while insertion you can take extra space to save the UID_address in a sorted set to apply bounded search. If you wanna remove something then the map balances itself (self balancing BST). If you wanna add something anywhere you will have access to adjacent node and you need to get another UID_address which fits in between the adjacent keys. Ordering is taken care by self-balancing BST. Since its non-trivial and requires usage of other Data Structures, hence we limit ourself to say binary search is not directly possible but saying its not possible no matter what would be an over-statement. Hope you got it.
The idea behind the approach is "At any give times, what is the maximum number of trains that are present". That should be the minimum number of platforms needed.
You can also think of pre-order traversal as printing when the track goes along the _left_ side of the node. For in order traversal, you print when it wraps around to go _under_ the node. For post order traversal, print the value when it comes along the _right_ side of the node.
Division method class Solution { private static final int[] values = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1}; private static final String[] symbols = {"M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"}; public String intToRoman(int num) { StringBuilder sb = new StringBuilder(); // Loop through each symbol, stopping if num becomes 0. for (int i = 0; i < values.length && num > 0; i++) { // Repeat while the current symbol still fits into num. while (values[i] <= num) { int repeat = num / values[i]; num = num % values[i]; while(repeat > 0){ sb.append(symbols[i]); repeat --; } } } return sb.toString(); } }