Skip to content

Commit fc53334

Browse files
committed
rearranged repo
1 parent c922eff commit fc53334

16 files changed

+15
-13
lines changed
Binary file not shown.
Binary file not shown.

Diff for: Competitive Programming Books/Greedy Algorithm.ppt

-906 KB
Binary file not shown.

Diff for: Bit_Magic.md renamed to bit_magic.md

+15
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,19 @@ flip bit : S ^= ~(1<<i)
205205
```
206206
----------------------------
207207

208+
* Swapping of 2 numbers using `XOR`
209+
210+
This method is fast and most effiecient. It doesn’t even require the use of 3rd variable.
211+
```
212+
// A quick way to swap a and b
213+
a ^= b;
214+
b ^= a;
215+
a ^= b;
216+
217+
// or you can use
218+
a ^= b ^= a ^= b
219+
```
220+
221+
----------------------------
222+
208223
source: * [geeksforgeeks](https://www.geeksforgeeks.org/bit-tricks-competitive-programming) * [returnzero](https://returnzerooo.wordpress.com/2016/06/30/বিটের-মজা-মজার-বিট)

Diff for: swap_numbers.md

-13
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)