Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Snowleopard_wu
Java
提交
0db62bb4
J
Java
项目概览
Snowleopard_wu
/
Java
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
Java
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0db62bb4
编写于
10月 24, 2020
作者:
G
github-actions
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Formatted with Google Java Formatter
上级
d27ded91
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
12 addition
and
14 deletion
+12
-14
Conversions/HexToOct.java
Conversions/HexToOct.java
+1
-1
DataStructures/Graphs/BellmanFord.java
DataStructures/Graphs/BellmanFord.java
+3
-3
DataStructures/Graphs/FloydWarshall.java
DataStructures/Graphs/FloydWarshall.java
+1
-1
DataStructures/Heaps/HeapElement.java
DataStructures/Heaps/HeapElement.java
+0
-1
DataStructures/Lists/SinglyLinkedList.java
DataStructures/Lists/SinglyLinkedList.java
+2
-2
Others/BestFit.java
Others/BestFit.java
+1
-1
Others/GuassLegendre.java
Others/GuassLegendre.java
+0
-1
Others/ReturnSubsequence.java
Others/ReturnSubsequence.java
+3
-3
Searches/JumpSearch.java
Searches/JumpSearch.java
+1
-1
未找到文件。
Conversions/HexToOct.java
浏览文件 @
0db62bb4
...
...
@@ -63,7 +63,7 @@ public class HexToOct {
decnum
=
hex2decimal
(
hexadecnum
);
// Pass the string to the hex2decimal function and get the decimal form in
// variable decnum
// variable decnum
// convert decimal to octal
octalnum
=
decimal2octal
(
decnum
);
...
...
DataStructures/Graphs/BellmanFord.java
浏览文件 @
0db62bb4
...
...
@@ -48,7 +48,7 @@ start vertex, end vertes and weights. Vertices should be labelled with a number
public
void
go
()
// Interactive run for understanding the class first time. Assumes source vertex is 0 and
// shows distaance to all vertices
// shows distaance to all vertices
{
Scanner
sc
=
new
Scanner
(
System
.
in
);
// Grab scanner object for user input
int
i
,
v
,
e
,
u
,
ve
,
w
,
j
,
neg
=
0
;
...
...
@@ -66,7 +66,7 @@ start vertex, end vertes and weights. Vertices should be labelled with a number
int
dist
[]
=
new
int
[
v
];
// Distance array for holding the finalized shortest path distance between source
// and all vertices
// and all vertices
int
p
[]
=
new
int
[
v
];
// Parent array for holding the paths
for
(
i
=
0
;
i
<
v
;
i
++)
dist
[
i
]
=
Integer
.
MAX_VALUE
;
// Initializing distance values
dist
[
0
]
=
0
;
...
...
@@ -115,7 +115,7 @@ start vertex, end vertes and weights. Vertices should be labelled with a number
double
dist
[]
=
new
double
[
v
];
// Distance array for holding the finalized shortest path distance between source
// and all vertices
// and all vertices
int
p
[]
=
new
int
[
v
];
// Parent array for holding the paths
for
(
i
=
0
;
i
<
v
;
i
++)
dist
[
i
]
=
Integer
.
MAX_VALUE
;
// Initializing distance values
dist
[
source
]
=
0
;
...
...
DataStructures/Graphs/FloydWarshall.java
浏览文件 @
0db62bb4
...
...
@@ -13,7 +13,7 @@ public class FloydWarshall {
new
int
[
numberofvertices
+
1
]
[
numberofvertices
+
1
];
// stores the value of distance from all the possible path form the source
// vertex to destination vertex
// vertex to destination vertex
Arrays
.
fill
(
DistanceMatrix
,
0
);
this
.
numberofvertices
=
numberofvertices
;
}
...
...
DataStructures/Heaps/HeapElement.java
浏览文件 @
0db62bb4
package
DataStructures.Heaps
;
/**
* Class for heap elements.<br>
*
...
...
DataStructures/Lists/SinglyLinkedList.java
浏览文件 @
0db62bb4
...
...
@@ -61,12 +61,12 @@ public class SinglyLinkedList {
checkBounds
(
position
,
0
,
size
);
Node
newNode
=
new
Node
(
data
);
if
(
head
==
null
)
{
/* the list is empty */
/* the list is empty */
head
=
newNode
;
size
++;
return
;
}
else
if
(
position
==
0
)
{
/* insert at the head of the list */
/* insert at the head of the list */
newNode
.
next
=
head
;
head
=
newNode
;
size
++;
...
...
Others/BestFit.java
浏览文件 @
0db62bb4
...
...
@@ -38,7 +38,7 @@ public class BestFit {
int
minDiff
=
findMaxElement
(
blockSizes
);
int
index
=
NO_ALLOCATION
;
// If there is no block that can fit the process, return NO_ALLOCATION as the
// result.
// result.
for
(
int
i
=
0
;
i
<
blockSizes
.
length
;
i
++)
{
// Find the most fitting memory block for the given process.
...
...
Others/GuassLegendre.java
浏览文件 @
0db62bb4
package
Others
;
/**
* Guass Legendre Algorithm ref https://en.wikipedia.org/wiki/Gauss–Legendre_algorithm
*
...
...
Others/ReturnSubsequence.java
浏览文件 @
0db62bb4
...
...
@@ -23,7 +23,7 @@ public class ReturnSubsequence {
private
static
String
[]
returnSubsequence
(
String
givenString
)
{
if
(
givenString
.
length
()
==
0
)
// If string is empty we will create an array of size=1 and insert "" (Empty string)
// in it
// in it
{
String
[]
ans
=
new
String
[
1
];
ans
[
0
]
=
""
;
...
...
@@ -33,7 +33,7 @@ public class ReturnSubsequence {
returnSubsequence
(
givenString
.
substring
(
1
));
// recursive call to get subsequences of substring starting from index
// position=1
// position=1
String
[]
ans
=
new
String
...
...
@@ -47,7 +47,7 @@ public class ReturnSubsequence {
givenString
.
charAt
(
0
)
+
SmallAns
[
k
];
// Insert character at index=0 of the given substring in front of every string
// in SmallAns
// in SmallAns
}
return
ans
;
}
...
...
Searches/JumpSearch.java
浏览文件 @
0db62bb4
...
...
@@ -31,7 +31,7 @@ public class JumpSearch implements SearchAlgorithm {
for
(
int
i
=
limit
-
blockSize
;
i
<=
limit
;
i
++)
{
if
(
array
[
i
]
==
key
)
{
/* execute linear search */
/* execute linear search */
return
i
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录