Skip to content

Commit

Permalink
style: add missing const in median_search2.cpp (#2734)
Browse files Browse the repository at this point in the history
  • Loading branch information
vil02 authored Sep 17, 2024
1 parent a0b7dee commit 9374b00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions search/median_search2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static void test() {
}
temp->next = nullptr;

ListNode* median = search::median_search2::middleNode(head1);
const ListNode* const median = search::median_search2::middleNode(head1);
assert(3 == median->val); // 3 is the value of the median node.
search::median_search2::deleteAll(head1);
std::cout << "test case:1 passed\n";
Expand All @@ -124,7 +124,7 @@ static void test() {
}
temp2->next = nullptr;

ListNode* median1 = search::median_search2::middleNode(head2);
const ListNode* const median1 = search::median_search2::middleNode(head2);
assert(4 == median1->val); // 4 is the value of the median node.
search::median_search2::deleteAll(head2);
std::cout << "test case:2 passed\n";
Expand Down

0 comments on commit 9374b00

Please sign in to comment.