How frequently you use bitwise operators and how much percentage of the time and/or memory complexity improved with these changes?
-
-
Answer:
I assume you mean using bitwise operators as opposed to higher level logic.. Such as logical operators. It's always implementation specific. If you have a small amount of code that runs very frequently, or you need real-time performance, then you're often making whatever optimizations you can manage. Every microsecond counts in a loop run thousands of times per second. Often bitwise operations are equally simple or simpler than higher level equivalents, if things are designed to accommodate. For changing a letter's case, just flip the 5th bit, for instance. EnumSets in Java are backed by very efficient bitmaps. And if you learn about bit-indexed trees, you'll be amazed. Why add the first 15 elements to get a sum when you can add precalculated sums of the first 8, next 4, next 2, and then the 15th.. Microsoft Cube calculates numbers very fast this way, mapping the precalculated totals to each bit. But if it's something that runs.infrequently, and playing with bits is much less intuitive or even cumbersome, then don't think twice about it and just stick with high level operations.
Scott Danzig at Quora Visit the source
Related Q & A:
- How can I use real time social data from Datasift and perform real time analytics on it?Best solution by Quora
- How much do phone sex operators make?Best solution by Yahoo! Answers
- How much is an additional Time Warner Cable Box DVR?Best solution by Yahoo! Answers
- How can I use my PSP inner memory?Best solution by Yahoo! Answers
- How Much Is The Percentage For Full Commission Sales?Best solution by Quora
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.