Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9de1d7d

Browse files
added to int util method in sll
1 parent 8bd4f9b commit 9de1d7d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎src/me/premaseem/myLib/MySLLNode.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ public MySLLNode(int[] arr){
2424

2525
}
2626

27+
public int toInt(){
28+
MySLLNode c = this;
29+
String ans= "";
30+
while(c!= null){
31+
int d = c.data;
32+
ans += ""+d;
33+
c = c.next;
34+
}
35+
return Integer.parseInt(ans);
36+
}
37+
2738
public void print(){
2839
MySLLNode c = this;
2940
System.out.print(" Singly Linked List is ");

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /