Home | Projects | Notes > Problem Solving > LC - E - 1356. Sort Integers by The Number of 1 Bits (struct, qsort, bubble sort)

LC - E - 1356. Sort Integers by The Number of 1 Bits (struct, qsort, bubble sort)

 

Solutions in C

Solution 1

This solution uses struct and the C standard library function qsort.

Complexity Analysis:

Solution:

 

Solution 2

This solution uses bubble sort.

Complexity Analysis:

Solution: