A Collection of Bit Programming Interview Questions solved in C++ (Volume 3)
- Length: 30 pages
- Edition: 1
- Language: English
- Publisher: CreateSpace Independent Publishing Platform
- Publication Date: 2014-05-22
- ISBN-10: 1495330729
- ISBN-13: 9781495330728
- Sales Rank: #1873893 (See Top 100 Books)
Bits is the second of a series of 25 Chapters devoted to algorithms, problem solving, and C++ programming. This book is about low level bit programming
Table of Contents
Chapter 1. Given an unsigned int, swap the bits in odd and even positions
Chapter 2. Print the binary representation of an unsigned int Solution Code
Chapter 3. Compute whether or not an unsigned number is a power of two
Chapter 4. Set the i-th bit
Chapter 5. Unset the i-th bit
Chapter 6. Toggle the i-th bit
Chapter 7. Given an unsigned number with only one bit set, find the position of this bit
Chapter 8. Count the number of bits set in an unsigned number
Chapter 9. Add two numbers without using arithmetic operators
Chapter 10. Given an array of integers where all the numbers are appearing twice find the only number which appears once
Chapter 11. Given an array of integers where all the numbers are appearing twice find the only two numbers which appears once
Chapter 12. Multiply two numbers without using arithmetic operators
Chapter 13. Compute the two’s complement for a given integer
Chapter 14. Isolate the rightmost bit set to 1
Chapter 15. Create a mask for trailing zeros
Chapter 16. Compute parity for a 32 bit number
Chapter 17. Swap two integers variables with no additional memory
Chapter 18. Swap bit i and j in a 64 bit number
Chapter 19. Reverse the order of bits in an unsigned integer
Chapter 20. Convert an integer to a string and a string to an integer
Chapter 21. Convert a number from base b1 to base b2
Chapter 22. Given a set S, compute the powerset of S
Chapter 23. Add two decimal strings representing two integers
Chapter 24. Generate all the bit patterns from 0 to such that successive patterns differ by one bit.
Chapter 25. Represent unsigned integers with variable length encoding using the continuation bit
Chapter 26. Represent an integer with variable length encoding using gamma encoding
Chapter 27. Represent an integer with variable length encoding using delta encoding
Chapter 28. Compute the average with no division