If you find this tutorial helpful, please do not forget to like , comment, share and It would be great if you can leave your feedback about the tutorial, as I have put a lot of hard work to make things easy for you. Thanks ..!! 🙏🙏🙏
@mohanbhati95954 жыл бұрын
make correction in Problem statement it's different.
@JavaAidTutorials4 жыл бұрын
thanks we have updated the problem statement link :)
@sovnaishwarya2 жыл бұрын
You are making it more complex
@rishiraj25487 ай бұрын
15:00 excellent! thanks
@codedecks4 жыл бұрын
Congratulations on 15k Subscribers 👍 Welcome back !!!
@JavaAidTutorials4 жыл бұрын
Thank you..😀 I also noticed after watching your comment
@memesmacha614 жыл бұрын
After a long time bro...we want many more videos from you!
@JavaAidTutorials4 жыл бұрын
Even we want to produce more content but situations are not in our favor that much.
@tusharhatwar45814 жыл бұрын
Thank You for coming Back 🙏🙏
@shivanigoswami27734 жыл бұрын
Hey hey hey thank you so much for come back again😍😍😍😍😍😍
@JavaAidTutorials4 жыл бұрын
Thanks to JAVAAID family to give so much of love ❤️❤️
@kvr94234 жыл бұрын
Great Contribution..Kudos
@anil20094 жыл бұрын
Guruji you are great. Where are you all these days
@JavaAidTutorials4 жыл бұрын
We are always with our JAVAAID FAMILY.❤️
@anil20094 жыл бұрын
I m trying hard to get into Zoho company guruji but I'm faling to find out good algorithm to slove the problem
@JavaAidTutorials4 жыл бұрын
have some passions and work hard you will see the results.
@sebajean-baptiste62409 ай бұрын
I know this is old. But I struggled to understand this solution. Elegant, but a bit complicated. I did it a different way that might be easier to understand. At least for me. public static void main(String[] args) { for (int period = 0; period < 9; period++ ) { int c = cycle(period); int result = period % 2 == 0 ? calculate(c) : calculate(c) - 1; System.out.println( period + " : " + result); } } public static int cycle(int period) { if( period % 2 == 0) return period / 2; return (period + 1) / 2; } public static int calculate(int cycle) { return Double.valueOf(Math.pow(2, cycle + 1)).intValue() - 1; }
There's probably a one liner, without bitwise math, but I'm having trouble figuring it out. Something like 2^(n-1) + n%2
@JohnWindberg4 ай бұрын
I find bitwise math to be unreadable.
@RahulKumar-ud3ct4 жыл бұрын
Sir , can't we apply a simple for loop with if (i%2==0){ Count =count +1;} And else { count =count *2 ;}
@JavaAidTutorials4 жыл бұрын
You can but bitwise operations are much faster than anything else. so for large input your program will be a little bit slow.
@VinayKumar-tv5bc4 жыл бұрын
@@JavaAidTutorials please elaborate this code as send by @rahul kumar
@shannu95724 жыл бұрын
happy teachers day javaaid maya
@JavaAidTutorials4 жыл бұрын
Thank you..😊 but who is maya🤔
@maqsamqureshi10522 жыл бұрын
Sir it is simple programming question or data structure question
@rishiraj25482 жыл бұрын
Wow! Many thanks
@optimusprime6924 жыл бұрын
Super solution!
@JavaAidTutorials4 жыл бұрын
Glad you think so!
@mahmmadhusen67944 жыл бұрын
Please upload more videos
@JavaAidTutorials4 жыл бұрын
Sure, we will try our best.
@indlasubramanyam95103 жыл бұрын
Audio is not up to the mark
@jaidheersirigineedi81104 жыл бұрын
Thank you sir!!
@JavaAidTutorials4 жыл бұрын
Most welcome!
@navinchainani47214 жыл бұрын
Sir plz explain also using if else
@JavaAidTutorials4 жыл бұрын
That approach is not optimal, but still you want, we have some old code, will paste it here for reference. Or for short use this algo- If cycle is even multiple height by 2 Else increase the height by 1
@navinchainani47214 жыл бұрын
@@JavaAidTutorials thanks
@fernandogaldino53093 жыл бұрын
Using if/else, try this... It works for me... public static int utopianTree(int n) { // Write your code here int height = 0; for(int i = 0; i
@salilkumarghosh98614 жыл бұрын
Sir can I solve these problems using C after watching all videos?
@JavaAidTutorials4 жыл бұрын
We always try to teach generic algorithm which is independent of any specific language. so you can use any language to implement the same
@RahdixCloudNine2 жыл бұрын
WTF ??? subscribed!
@saikande80854 жыл бұрын
Can you explain again sir
@JavaAidTutorials4 жыл бұрын
The good thing about video tutorial is , if you have any doubt you can replay it. We are ready to explain again, just watch this video one more time. I hope things will be more clear next time.:)
@manojb16063 жыл бұрын
Voice very un easy to hear
@abhisekpanda37012 жыл бұрын
public class utopianTree { public static void main(String[] args) { int n=utopian(5); //utopian(7); System.out.println(n); } static int utopian(int n) { int value=1; for(int i=0;i