File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -57,10 +57,12 @@ public static int getNumberByReversingBitsV1(int n) {
5757 }
5858
5959 /**
60- * This method is similar to {@link #getNumberByReversingBitsV1(int)} but here we put
61- * the set bits of {@param n} in {@code reverse number} and keep on shifting the reverse number
62- * left until {@param n} becomes {@code zero} and finally shift left for the remaining number of
60+ * This method is similar to {@link #getNumberByReversingBitsV1(int)} but here we put
61+ * the set bits of {@param n} in {@code reverse number} and keep on shifting the reverse number
62+ * left until {@param n} becomes {@code zero} and finally shift left for the remaining number of
6363 * bits used to represent the number.
64+ * <p/>
65+ * Time complexity: O(log n) (as we are dividing 'n' by 2 in each iteration)
6466 *
6567 * @param n
6668 * @return
You can’t perform that action at this time.
0 commit comments