Master Data Structures & Algorithms for FREE at AlgoMap.io/
@danh9002Ай бұрын
Great video! For those of us who used to do assembler, it was a nice trip down memory lane!
@tinayu35052 ай бұрын
how the ampersand left shift trick works is & finds where there is 1 and 1 (the only case that results in carry) and places a 1 to mark the carry, the leftshift applies the carry to the next bit
@ghfranklin4 ай бұрын
Hi sir, from Nigeria, really enjoy watching your videos, wanted to make a request for LRU cache
@anantakesharipanda40859 күн бұрын
Could you give a shot to Leetcode *#1073**,* adding negative Binary numbers?
@Ellenki_0072 ай бұрын
On which editor you are explaining sir?
@user-jm6gp2qc8x4 ай бұрын
Hey gregg! It's time you update the list with some hard level problems or maybe create a new tab and put some hards in them :)
@manikmukhija5 ай бұрын
What language do you think is better for dsa... python or java for future?
@binirxn5 ай бұрын
C++
@3lpme4 ай бұрын
Java
@mehrankhan64124 ай бұрын
Hey Gregg I wanted To ask you for a favour Please make A Video On timeseries Dataset Multivariate with Implementation of PCA-LSTM hybrid approach On It
@azimjonalijonov19154 ай бұрын
hI CAN YOU GIVE TIPS HOW TO MASTER ATBACKTRACKIGN PROBLEMS?
@shaneastone2 ай бұрын
The solution is invalid. String b can be very large and exceed the capacity of an integer.
@xingyuxiang16372 ай бұрын
I guess the point is to walk through the code and realize that the greedy part is to get all the carriers in one operation. Somehow, the final result matches the correct result. It is hard to prove it wrong mathematically or find a counter-example. A greedy approach, for example, replacing a queue with a priority queue appears in hard problems. I think that the good side in this context is to introduce multi-threading, like multiple threads can get the targets all at once. People usually will not do bit-manipulations a lot. So, that part is exercised. I actually would prefer to see the codes that perform additions concurrently because it aligns with maths. 10^4 does not require greedy approaches most of the time. Clearly, the idea of a greedy approach is harder than DP. Straightforwardly, DP is to list all possible cases by trees, just like a nested for loop, which is actually not needed in the first problem.
@ramziddinaliqulov-zg3jtАй бұрын
Hello my name is Otabek. I am from Uzbekistan. I am 15 years old.I am going to be member of IOI. But I don't understand DSA.Please help me ?
@alchenerdАй бұрын
What the... How do you deal with overflow of the variable `carry`? ``` cpp[] string addBinary(string a, string b) { if (a.size() < b.size()) { return addBinary(b, a); } reverse(a.begin(), a.end()); reverse(b.begin(), b.end()); bool carry = false; string s = ""; for (int i = 0; i < a.size(); ++i) { bool aa = a[i] == '1'; bool bb = i < b.size() ? b[i] == '1' : false; char digit = '0' + (aa ^ bb ^ carry); s += digit; carry = (carry & (aa | bb)) | (aa & bb); } if (carry) { s += '1'; } reverse(s.begin(), s.end()); return s; } ```
@anantakesharipanda40859 күн бұрын
That’s the beauty of python, int do not overflow, python just dynamically allocates more bits to store a larger int. Similar to what you’d see in Boost libraries of C++.
@ramziddinaliqulov-zg3jtАй бұрын
Give me roadmap please ?!
@shhhrruutii3 ай бұрын
Hey thank you. Can you upload more videos on DSA with python. It's really helping me since I'm currently a computer science engineering student and on my way to become a data scientist.
@user-jm6gp2qc8x4 ай бұрын
what the
@akhilmohnnАй бұрын
Can't we just simply do: final=bin(int(a,2)+int(b,2))[2:] return final
@Rupok085 ай бұрын
sir, i am from bangladesh . i am only 16 years old. i have learned c and learning c++.i dream to work in fang companny .what would be my roadmap ? i kindda suck at solving problem but i try. please help me , you are my insperation 😊😊