Find kth largest element in running stream of numbers
December 26, 2019
Tricks to compute the time and space complexities. Part-1 (Array)
December 28, 2019

Bitwise Operations: Working on individual bits

Write code to perform the basic operations on individual bits of a number (rather than the entire number):

  • setBit – Set a particular bit.
  • resetBit – Reset a particular bit.
  • toggleBit – Toggle a particular bit.
  • getBit – return the value (0 or 1) stored at a particular bit position.

Leave a Reply

Your email address will not be published. Required fields are marked *