ALL

Every post by default are under this category.

ALLCODE CRAFT

Generate binary numbers using a queue

Problem

Generate binary numbers from 1 to any given number, “n”, using a queue.

Function Signature

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
List<string> GenerateBinaryNumber(int n)
List<string> GenerateBinaryNumber(int n)
List<string> GenerateBinaryNumber(int n)

Example Input and Output

n = 1 => (1)

n = 3 => ( 1, 10, 11)

Problem Solving Strategy

Assuming …

Read More