Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
higboys
javascript-algorithms
提交
4b6c6011
J
javascript-algorithms
项目概览
higboys
/
javascript-algorithms
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
javascript-algorithms
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4b6c6011
编写于
12月 20, 2020
作者:
O
Oleksii Trekhleb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add Spanish link for the Linked List README.
上级
88cef5f5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
25 deletion
+25
-25
src/algorithms/math/is-power-of-two/README.md
src/algorithms/math/is-power-of-two/README.md
+7
-8
src/data-structures/linked-list/README.md
src/data-structures/linked-list/README.md
+18
-17
未找到文件。
src/algorithms/math/is-power-of-two/README.md
浏览文件 @
4b6c6011
# 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
...
...
src/data-structures/linked-list/README.md
浏览文件 @
4b6c6011
...
...
@@ -5,23 +5,24 @@ _Read this in other languages:_
[
_Русский_
](
README.ru-RU.md
)
,
[
_日本語_
](
README.ja-JP.md
)
,
[
_Português_
](
README.pt-BR.md
)
,
[
_한국어_
](
README.ko-KR.md
)
In computer science, a
**linked list**
is a linear collection
of data elements, in which linear order is not given by
their physical placement in memory. Instead, each
element points to the next. It is a data structure
consisting of a group of nodes which together represent
a sequence. Under the simplest form, each node is
composed of data and a reference (in other words,
[
_한국어_
](
README.ko-KR.md
)
,
[
_Español_
](
README.es-ES.md
)
,
In computer science, a
**linked list**
is a linear collection
of data elements, in which linear order is not given by
their physical placement in memory. Instead, each
element points to the next. It is a data structure
consisting of a group of nodes which together represent
a sequence. Under the simplest form, each node is
composed of data and a reference (in other words,
a link) to the next node in the sequence. This structure
allows for efficient insertion or removal of elements
from any position in the sequence during iteration.
More complex variants add additional links, allowing
efficient insertion or removal from arbitrary element
references. A drawback of linked lists is that access
time is linear (and difficult to pipeline). Faster
access, such as random access, is not feasible. Arrays
allows for efficient insertion or removal of elements
from any position in the sequence during iteration.
More complex variants add additional links, allowing
efficient insertion or removal from arbitrary element
references. A drawback of linked lists is that access
time is linear (and difficult to pipeline). Faster
access, such as random access, is not feasible. Arrays
have better cache locality as compared to linked lists.
![
Linked List
](
https://upload.wikimedia.org/wikipedia/commons/6/6d/Singly-linked-list.svg
)
...
...
@@ -75,7 +76,7 @@ Contains(head, value)
return true
end Contains
```
### Delete
```
text
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录