Now Now Now

내일은 없어

Main menu

Skip to primary content
Skip to secondary content
  • Home
  • About Me

Monthly Archives: March 2017

Bit Manipulation

Posted on March 2, 2017 by Ying
Reply

1. Extract the last set bit

x & (-x)

eg.  x: 00110010

-x: 11001101 + 1 = 11001110

x & (-x) = 00000010

2. Remove the last set bit

x – x & (-x)

FacebookTwitterGoogle+Share
Posted in Others | Leave a reply

Recent Posts

  • Differences between java.util.HashMap vs java.util.Hashtable vs java.util.LinkedHashMap vs java.util.TreeMap 
  • sdfsf
  • Leetcode: 349. Intersection of Two Arrays
  • Bit Manipulation
  • TCP VS UDP

Recent Comments

  • Ying on Leetcode: Best Time to Buy and Sell Stock II
  • Bin on About Me
  • Shawn on Leetcode: Best Time to Buy and Sell Stock II
  • Shawn on Leetcode: Best Time to Buy and Sell Stock II

Archives

  • February 2018
  • August 2017
  • March 2017
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • October 2014
  • September 2014
  • March 2013
  • February 2013
  • January 2013
  • December 2012

Categories

  • Array
  • BFS
  • Binary Search
  • Brain Teaser
  • Database
  • Deque
  • Design Pattern
  • DFS
  • Divide & Conquer
  • Dynamic Programming
  • Graph
  • HashMap
  • Heap
  • Interview Questions
  • Java
  • Leetcode
  • LintCode Copyright
  • List
  • Math
  • network
  • Oracle
  • Others
  • Recursion
  • Segment Tree
  • Sorting
  • Stack
  • String
  • SubArray
  • System Design
  • Tree
  • Two Pointers

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Last searched terms

  • - 886

Last referers

  • - ying.ninja/?cat=23

Visitors Online

  • 01 visitor(s) online
  • powered by WassUp
March 2017
M T W T F S S
« Nov   Aug »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Hit Counter provided by Skylight
Proudly powered by WordPress