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 9374b00

Browse files
authored
style: add missing const in median_search2.cpp (TheAlgorithms#2734)
1 parent a0b7dee commit 9374b00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎search/median_search2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static void test() {
103103
}
104104
temp->next = nullptr;
105105

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

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

0 commit comments

Comments
(0)

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