Skip to content

Commit

Permalink
added bitmasks
Browse files Browse the repository at this point in the history
  • Loading branch information
kdn251 committed Mar 10, 2017
1 parent 84e6919 commit 5ee07e5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ or equal to those of the children and the lowest key is in the root node
##Bitmasks
* Bitmasking is a technique used to perform operations at the bit level. Leveraging bitmasks often leads to faster runtime complexity and
helps limit memory usage
* Test kth bit: 's & (1 << k)'
* Set kth bit: 's |= (1 << k)'
* Turn off kth bit: 's &= ~(1 << k)'
* Toggle kth bit: 's ^= ~(1 << k)'
* Intersection: 's & t'
* Union: 's | t'
* Set Subtraction: 's & ~t'
* Test kth bit: `s & (1 << k)`
* Set kth bit: `s |= (1 << k)`
* Turn off kth bit: `s &= ~(1 << k)`
* Toggle kth bit: `s ^= ~(1 << k)`
* Intersection: `s & t`
* Union: `s | t`
* Set Subtraction: `s & ~t`

## Runtime Analysis

Expand Down

0 comments on commit 5ee07e5

Please sign in to comment.