trekhleb / trekhleb/javascript-algorithms

Bit Reversal missing?

Open
#692 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
197k
Forks
31k
PR merge metrics
No merged PRs in 30d

Description

Something along the lines of:

function bitReverse(num){
        var result = 0;
        for (var i = 0; i < 8; i++) {
	        result = result * 2 + (num % 2);
	        num = Math.floor(num / 2);
        }
       return result;
}

var bitReverseLookup = function() {
	var lookup=[];
	for(var n=0; n<256; n++) {
		lookup[n] = bitReverse(n);
	}
	return lookup;
}();

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no file or test. Search the repository for existing bit-manipulation algorithms and their tests, then compare the requested bit-reversal behavior with nearby conventions. Done means the missing functionality is implemented consistently with the project and its behavior is covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.