FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java/DataStructures/HashMap/Hashing/LinkedList.java at master · java66liu/Java · GitHub
java66liu
/
Java
Public
forked from
TheAlgorithms/Java
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Java
/
DataStructures
/
HashMap
/
Hashing
/
LinkedList.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
63 lines (51 loc) · 914 Bytes
Breadcrumbs
Java
/
DataStructures
/
HashMap
/
Hashing
/
LinkedList.java
Copy path
File metadata and controls
63 lines (51 loc) · 914 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package
DataStructures
.
HashMap
.
Hashing
;
class
LinkedList
{
private
Node
Head
;
private
int
size
;
public
LinkedList
() {
Head
=
null
;
size
=
0
;
}
public
void
insert
(
int
data
) {
Node
newnode
=
new
Node
(
data
);
size
++;
if
(
Head
==
null
) {
Head
=
newnode
;
}
else
{
newnode
.
next
=
Head
;
Head
=
newnode
;
}
}
public
void
delete
(
int
data
) {
if
(
size
==
0
) {
System
.
out
.
println
(
"UnderFlow!"
);
return
;
}
else
{
Node
curr
=
Head
;
if
(
curr
.
data
==
data
) {
Head
=
curr
.
next
;
size
--;
return
;
}
else
{
while
(
curr
.
next
.
next
!=
null
) {
if
(
curr
.
next
.
data
==
data
){
curr
.
next
=
curr
.
next
.
next
;
return
;
}
}
System
.
out
.
println
(
"Key not Found"
);
}
}
}
public
void
display
() {
Node
temp
=
Head
;
while
(
temp
!=
null
) {
System
.
out
.
printf
(
"%d "
,
temp
.
data
);
temp
=
temp
.
next
;
}
System
.
out
.
println
();
}
}
Back
|
FazBrowse Home
|
New Git URL