1.

Which one of the following operations returns the first occurrence of bit 1 in bit arrays?(a) Find First Zero(b) Find First One(c) Counting lead Zeroes(d) Counting lead OneThe query is from Bit Array topic in portion Arrays Types of Data Structures & Algorithms IThis question was posed to me by my college director while I was bunking the class.

Answer»

The correct option is (b) FIND First One

The best EXPLANATION: Find First One operation returns the first occurrence of bit 1 in the bit array. Find First Zero operation returns the first occurrence of bit 0 in the bit array. If the most significant bit in bit array is 1, then COUNT lead zeroes operation returns the NUMBER of zeroes present before the most significant bit. If the most significant bit in bit array is 0, then the count lead one returns the number of ONES present before the most significant bit.



Discussion

No Comment Found

Related InterviewSolutions