+ Reply to Thread
Results 1 to 2 of 2

Thread: find number of bit swap required

  1. #1
    Surfer is offline Senior Member
    Join Date
    Mar 2010
    Posts
    321

    find number of bit swap required

    Given two integers A & B. Determine how many bits required to convert A to B. Write a function
    int BitSwapReqd(int A, int B);

  2. #2
    Surfer is offline Senior Member
    Join Date
    Mar 2010
    Posts
    321
    x = A^B
    count set bits in x, those are the number of bit to be swapped to convert from A to B

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Find number or just smaller number
    By TopGun in forum Amazon
    Replies: 1
    Last Post: 2nd July 2010, 04:43
  2. Swap adjacent node
    By TopGun in forum Amazon
    Replies: 1
    Last Post: 23rd April 2010, 00:20

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts