Name

bit_rot_left

Synopsis

void bit_rot_left(unsigned char *bits, int size, int count);

Return Value

None.

Description

Rotates the buffer bits, containing size bits, to the left count bits. After the operation, the leftmost count bits become the count rightmost bits in the buffer, and all other bits are shifted accordingly.

Complexity

O (n β), where n is the number of bits rotated to the left and β is the number of bits in the buffer.

Get Mastering Algorithms with C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.