Computers and Technology
Computers and Technology, 24.08.2019 14:30, penelope0

Abinary gap within a positive integer n is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of n. e. g.: the number 20 has binary representation 10100 and contains one binary gap of length 1. the number 15 has binary representation and has no binary gaps. write a function: class solution { public int binary_gap(int n); } that, given a positive integer n, returns the length of its longest binary gap. the function should return 0 if n doesn't contain a binary gap.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:30, ayoismeisjuam
What are compression artifacts? 1) visible defects in the picture caused by the nature of the compression algorithm. 2) numbers that tell a web server how much to compress a picture for faster transmission. 3) invisible defects in the picture preserved by lossless compression. 4) numbers that tell a photo editing program how much to compress a picture for faster transmission.
Answers: 3
image
Computers and Technology, 22.06.2019 23:30, jhonpiper
For her science class, elaine is creating a presentation on weather in the united states. she wants to make the presentation beautiful and interesting by drawing simple cloud or wave shapes. which is the best way for elaine to draw these shapes?
Answers: 1
image
Computers and Technology, 23.06.2019 16:30, saintsfan2004
How to do this programming flowchart?
Answers: 3
image
Computers and Technology, 23.06.2019 16:30, 19thomasar
How to do this programming flowchart?
Answers: 3
Do you know the correct answer?
Abinary gap within a positive integer n is any maximal sequence of consecutive zeros that is surroun...

Questions in other subjects: