File tree Expand file tree Collapse file tree 4 files changed +6
-11
lines changed Expand file tree Collapse file tree 4 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 1
1
package me .ramswaroop ;
2
2
3
3
import me .ramswaroop .common .*;
4
- import me .ramswaroop .linkedlists .SingleLinkedList ;
5
4
6
5
import java .util .Scanner ;
7
6
@@ -135,7 +134,7 @@ public static void main(String[] args) {
135
134
case 5 :
136
135
out .println ("Enter value:" );
137
136
item = Integer .parseInt (in .nextLine ());
138
- out .println ("Removed: " + singleLinkedList .remove (item ));
137
+ out .println ("Removed: " + singleLinkedList .removeItem (item ));
139
138
singleLinkedList .printList ();
140
139
break ;
141
140
case 6 :
Original file line number Diff line number Diff line change 1
- package me .ramswaroop .linkedlists ;
2
-
3
- import me .ramswaroop .common .LinkedList ;
1
+ package me .ramswaroop .common ;
4
2
5
3
import static java .lang .System .out ;
6
4
@@ -76,7 +74,7 @@ public E remove(int index) {
76
74
}
77
75
78
76
@ Override
79
- public boolean remove (E item ) {
77
+ public boolean removeItem (E item ) {
80
78
return false ;
81
79
}
82
80
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ public interface LinkedList<E> {
114
114
* @param item
115
115
* @return {@code true} if this list contained the specified element
116
116
*/
117
- boolean remove (E item );
117
+ boolean removeItem (E item );
118
118
119
119
/**
120
120
* Replaces the element at the specified position in this list with the specified element.
Original file line number Diff line number Diff line change 1
- package me .ramswaroop .linkedlists ;
2
-
3
- import me .ramswaroop .common .LinkedList ;
1
+ package me .ramswaroop .common ;
4
2
5
3
import java .util .NoSuchElementException ;
6
4
@@ -122,7 +120,7 @@ public E remove(int index) {
122
120
}
123
121
124
122
@ Override
125
- public boolean remove (E item ) {
123
+ public boolean removeItem (E item ) {
126
124
isLinkedListEmpty ();
127
125
128
126
if (!contains (item )) return false ;
You can’t perform that action at this time.
0 commit comments