Add Spanish link for the Linked List README.

This commit is contained in:
Oleksii Trekhleb
2020-12-20 20:18:12 +01:00
parent 88cef5f548
commit 4b6c601158
2 changed files with 24 additions and 24 deletions

View File

@@ -1,14 +1,13 @@
# Is a power of two
Given a positive integer, write a function to find if it is
Given a positive integer, write a function to find if it is
a power of two or not.
**Naive solution**
In naive solution we just keep dividing the number by two
unless the number becomes `1` and every time we do so we
check that remainder after division is always `0`. Otherwise
the number can't be a power of two.
unless the number becomes `1` and every time we do so, we
check that remainder after division is always `0`. Otherwise, the number can't be a power of two.
**Bitwise solution**
@@ -23,8 +22,8 @@ signed integer with a value of -128 looks like: `10000000`)
8: 1000
```
So after checking that the number is greater than zero,
we can use a bitwise hack to test that one and only one
So after checking that the number is greater than zero,
we can use a bitwise hack to test that one and only one
bit is set.
```
@@ -38,11 +37,11 @@ For example for number `8` that operations will look like:
- 0001
----
0111
1000
& 0111
----
0000
0000
```
## References