[C] Implement linear iterator
[C] Working implementation of linear iterator
[C] Refactor to common method for incrementing bucket/sub_bucket indexes