FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
crackingCodingInterview/NodeLinkedList.java at master · kumarravi/crackingCodingInterview · GitHub
kumarravi
crackingCodingInterview
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
crackingCodingInterview
/
NodeLinkedList.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (31 loc) · 611 Bytes
Breadcrumbs
crackingCodingInterview
/
NodeLinkedList.java
Copy path
File metadata and controls
39 lines (31 loc) · 611 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
package
cracking
.
coding
;
public
class
NodeLinkedList
{
NodeLinkedList
next
;
int
value
;
NodeLinkedList
(
int
val
){
this
.
value
=
val
;
this
.
next
=
null
;
}
public
void
insert
(
int
val
){
NodeLinkedList
New
=
new
NodeLinkedList
(
val
);
NodeLinkedList
n
=
this
;
while
(
n
.
next
!=
null
){
n
=
n
.
next
;
}
n
.
next
=
New
;
}
public
NodeLinkedList
delete
(
NodeLinkedList
head
,
int
val
){
NodeLinkedList
n
=
head
;
if
(
n
.
value
==
val
){
return
n
.
next
;
}
while
(
n
.
next
!=
null
){
if
(
n
.
next
.
value
==
val
){
n
.
next
=
n
.
next
.
next
;
return
head
;
}
n
=
n
.
next
;
}
return
head
;
}
}
Back
|
FazBrowse Home
|
New Git URL