File tree 2 files changed +52
-0
lines changed 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ package Grind169 .LinkedLists ;
2
+
3
+ public class SwapNodesInPairs_24 {
4
+ public class ListNode {
5
+ int val ;
6
+ ListNode next ;
7
+ ListNode () {}
8
+ ListNode (int val ) { this .val = val ; }
9
+ ListNode (int val , ListNode next ) { this .val = val ; this .next = next ; }
10
+ }
11
+
12
+ public static void main (String [] args ) {
13
+
14
+ }
15
+
16
+ public static ListNode swapPairs (ListNode head ) {
17
+ ListNode temp ;
18
+ if (head ==null ){
19
+ return null ;
20
+ }else if (head != null && head .next ==null ){
21
+ return head ;
22
+ }else {
23
+ temp =head .next ;
24
+ head .next =temp .next ;
25
+ temp .next =head ;
26
+ head =temp ;
27
+ head .next .next = swapPairs (head .next .next );
28
+ return head ;
29
+ }
30
+ }
31
+ }
Original file line number Diff line number Diff line change
1
+ package Grind169 .Stacks ;
2
+
3
+ import java .util .Scanner ;
4
+ import java .util .Stack ;
5
+
6
+ public class BackSpaceStringCompare_844 {
7
+ public static void main (String [] args ) {
8
+ Scanner kbr = new Scanner (System .in );
9
+ System .out .println ("Type 1st string: " );
10
+ String s = kbr .nextLine ();
11
+ System .out .println ("Enter 2nd String: " );
12
+ String t = kbr .nextLine ();
13
+
14
+ boolean check = backspaceCompare (s , t );
15
+ System .out .println (check );
16
+ }
17
+
18
+ public static boolean backspaceCompare (String s , String t ) {
19
+
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments