Python program to swap two numbers without using third variable#python#codm#education#pythontutorial

preview_player
Показать описание
Welcome to The Royal Coding!🎉
Check out our website for code, concept, blogging and many more....

🌐 Connect with us:
🐦Twitter: @TheRoyalCoding
📸Instagram: @theroyalcoding
👍Facebook: /TheRoyalCoding
Рекомендации по теме
Комментарии
Автор

You can do a, b = b, a. That works too

legomaster_tg
Автор

Your integer overflow vulnerability is making dennis richie roll in his grave!!! The modern LLVM compiler pipeline has spent decades optimizing temporary variable allocation with ssa form, while your "clever" code is destroying both the ARM and x86 pipelines ability to perform speculative execution!!! Your arithmetic tricks are creating serial dependencies in the cpu's reservation stations, completely nullifying out of order execution! The L1 cache prefetch logic cant establish any coherent stride pattern, the branch prediction unit is stalling on every speculative path, and dont you dare suggest your XOR swap - it creates a serial dependency chain that destroys the instruction level parallelism and prevents both micro-op and macro-op fusion on modern architectures! A clean temporary variable allows the register allocator to maintain optimal register pressure and enables store to load forwarding! But no, you had to play code golf and create non-temp memory access patterns that destroy cache locally! The page table walker is thrashing, and the tlb hit rate has dropped to single digits!

dot