Java DSA Practice

Watch and track your favorite playlist.

Curated by: Anurag Affection (122 videos)


Currently Playing: Java DSA 165 • Way 02 • Bit Manipulation • update ith bit of number in binary in Java

165 update ith bit (way 02) A number, an index, & a bit will be given this problem is same as previous , but different solutions Example -- Number = 10 , index = 2, a bit = 1 -- Number 10 = 1010 in binary -- updating with bit 1 at index 2 = 1110 -- result = 1110 = 14 in decimal example -- Number = 10, index = 1, a bit = 0 -- Number 10 = 1010 in binary -- updating with bit 0 at index 1 = 1000 -- result = 8


Tracks in this Playlist