DSA Shorts with MIK - 7
Welcome to DSA Shorts with MIK No. 7
In this DSA short, we will learn how to multiply/divide a number by 2^k using bit-wise shift operations.
Bitwise Multiplication:
Multiplying by 2^k can be efficiently done using a left shift operation: x left-shift by k. This operation effectively shifts the bits of x to the left by k positions, which is equivalent to multiplying by 2^k
. Left shifting is very fast and usually takes a single CPU cycle.
Bitwise Division:
Division by 2^k can be efficiently done using a right shift operation: x right-shift by k. This operation effectively shifts the bits of x to the right by k positions, which is equivalent to division by 2^k
. Right shifting is very fast and usually takes a single CPU cycle.
#shorts #dsa #MIK #codestorywithmik #bit #bits #bitmanipulation #bitmagic #education #computerscience #codinginterview #codeinterpreter #automobile #codingchallenge #maths #leetcodethehardway #codingproblem #quotes #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge#leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #coding #programming #100daysofcode #developers #techjobs #datastructures #algorithms #webdevelopment #softwareengineering #computerscience #pythoncoding #codinglife #coderlife #javascript #datascience #leetcode #leetcodesolutions #leetcodedailychallenge #codinginterview #interviewprep #technicalinterview #interviewtips #interviewquestions #codingchallenges #interviewready #dsa #hindi #india #hindicoding #hindiprogramming #hindiexplanation #hindidevelopers #hinditech #hindilearning #helpajobseeker #jobseekers #jobsearchtips #careergoals #careerdevelopment #jobhunt #jobinterview #github #designthinking #learningtogether #growthmindset #digitalcontent #techcontent #socialmediagrowth #contentcreation #instagramreels #videomarketing #codestorywithmik #codestorywithmick #codestorywithmikc #codestorywitmik #codestorywthmik #codstorywithmik #codestorywihmik #codestorywithmiik #codeistorywithmik #codestorywithmk #codestorywitmick #codestorymik #codestorwithmik