@@ -155,7 +155,7 @@ def reverse_linked_list(ll: LinkedList) -> LinkedList:
155
155
return output_ll
156
156
157
157
158
- def palindrome_constant_space (ll : LinkedList ) -> bool :
158
+ def is_palindrome_constant_space (ll : LinkedList ) -> bool :
159
159
"""
160
160
Same as the palindrome function below, but
161
161
with constant space
@@ -178,7 +178,7 @@ def palindrome_constant_space(ll: LinkedList) -> bool:
178
178
return True
179
179
180
180
181
- def palindrome (ll : LinkedList ) -> bool :
181
+ def is_palindrome (ll : LinkedList ) -> bool :
182
182
"""
183
183
Given a linked list, this function will check if the
184
184
linked list is a palindrome.
@@ -195,7 +195,7 @@ def palindrome(ll: LinkedList) -> bool:
195
195
return ll == reverse_linked_list (ll )
196
196
197
197
198
- class TestPalindrome (unittest .TestCase ):
198
+ class TestIsPalindrome (unittest .TestCase ):
199
199
200
200
def setUp (self ):
201
201
self .test_cases = [
@@ -233,13 +233,13 @@ def setUp(self):
233
233
)
234
234
]
235
235
236
- def test_palindrome (self ):
236
+ def test_is_palindrome (self ):
237
237
for ll , expected in self .test_cases :
238
- self .assertEqual (palindrome (ll ), expected , msg = ll )
238
+ self .assertEqual (is_palindrome (ll ), expected , msg = ll )
239
239
240
- def test_palindrome_constant_space (self ):
240
+ def test_is_palindrome_constant_space (self ):
241
241
for ll , expected in self .test_cases :
242
- self .assertEqual (palindrome_constant_space (ll ), expected , msg = ll )
242
+ self .assertEqual (is_palindrome_constant_space (ll ), expected , msg = ll )
243
243
244
244
245
245
if __name__ == '__main__' :
0 commit comments