Reverse an Array without using extra memory space(String reverse)
HTML-код
- Опубликовано: 9 окт 2024
- Reverse an Array without using extra memory space. The array can also be a string.We using swap operation here. The method is space efficient. The space complexity is O(N).
only teacher in RUclips ,who really started teaching in less than 7 seconds. Rest all waste 4-5 min for telling us to subscribe and like
Thank you. Simple and straight. God bless you for your work.
Sir your videos are awesome. I have seen around 10 videos of yours as of now, you explain every thing very clearly and slowly and i find it very good and better than many famous channels. Kindly keep the good work
Amazing videos. Your explanations are crystal clear. Another algorithm related to array rotation is block swapping, could you please make a video on that as the concept is slightly harder for newcomers to understand :) Your effort is much appreciated.
I am still having trouble because I need to assign the value at a specific index to that temp value. But what method in java does that? chartAt and indexOf won't do it.
Bayya, you are really rocking....should be in google or microsoft
without using tmp how you can swap? it lost as soon as you swap first element to last element, you need to have last element somewhere?
here the swap function has been kept abstract...it has the temp variable logic you are asking for
hi sir good morning thanks for making such vedio on algorithm which helping us very much thanks for your effort I have one request could you please make an vedio on finding time complexity how to calculate it will be very helpful to us.Thanks
Simply superb!! without wasting our time.. In a short time explained clearly
please method video on array rotation by juggling method...especially the why we need to take LCM of the no of elements and no of shifts
Hi,
It was nice video.
Could you please add a video about egg throwing algorithm to get floor no of the building.
Amazing video sir yennakku python subject la arrays and method of array , function explain panugga sir
but sir you are not storing the resulted string any where.
if you wanted to reverse the string(let say x="anything") and store that string in same variable (x = "gnihtyna") then through this process it can't be done.
thank you from the cluster of 1337!
Great teacher lovely video it helped me on my project thank you very much!!!
kindly check the details
I think you mean *decrement* e variable.
Really nice and great explanation of all your ds and algorithms. I have learnt lot of logics and working flow from your session. Please make video for how to crack Google, Microsoft, Amazon interview. It would be great help.
We will need a temp variable for swapping. However for positive numbers i guess we can use swap without temp variable, for example a=5 and b=8, then a=a+b, b= a-b, a=a-b will swap the numbers.
thanks for that tutorial ..but please could you also teach how you can reverse a "hello world" so that it should look like "world hello" and explain step by step please hope you respond this request as fast as possible
Hi, Bro nice explanation and nice teaching. Thank you for sharing your knowledge with us. We support you.
Thank you for such valuable time.. could please upload on String permutations algorithm
for swapping you need to use a temporary variable what about that extra memory?
Harshal Chaudhari that will be very small Nazi. and you can swap without temp too
hi ~ how to swap without temp?
search on google
yeah I know , thanks!
If the extra memory being used is not growing with the sample size it is an in place algorithm
what if we use for loop from size-1 and then print the elements??
Well explained. worth watching
end and start pointers are extra memory too!
I didn't understand how to write this code on C#... some help pls?
Sir plz make more videos on question asked by product based company in placements.
Well explained! Thanks!
kindly check the details
Helpful vedeo sir 👍👍👍
Sir, how it could be done without using swap() ?
A temporary variable and "bubble sort"
Super nicely explained..
Sir..
draw a flow diagram to input your name and print it in reverse
did not mention s , e,n-1 ..which data type we taken
It's not datatype, its variables you create. int s, int e
I think without using extra memory you meant in-place algo. That would be the correct word to use here.
more i see your videos more i love your teaching. create a patreon page
i forgot to mention the program should be in c programming
good job
Amazing job bro
What about odd number of elements?
kindly check the details
Awesome
You are clearly using a temp variable. So your solution is pointless.
however, one might use the following code to swap without a 3rd variable.
assume a=5, b=10
a=a+b //a=15, b=10
b=a-b //a=15, b= 5
a=a-b //a=10, b=5
For characters, you can do it by converting the number into ASCII equivalent, and performing the same computation.
a = a ^ b ^ (b = a) will do the swap without extra mem.
Lot of loopholes are there
Thankyou :)
kindly check the details
boss everything was going good but you ruin that at last by sayings friends. you are bro man
sir did you have artificial intelengency plz up load video sir plz plz
Sir last me final coding v likhiye na 🙏🙏🙏🙏
kindly check the details
sir graph algorithm
yes sure..sorry for late....i m trying to give the most time....
nice accent!