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 3e996a6

Browse files
committed
"Find Median from Data Stream": change variable name
1 parent ab6f21d commit 3e996a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/295.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ void swap(int *a, int *b) {
1919

2020
void addHeap(int **heap, int *size, int *capacity, int data) {
2121
if (*size == *capacity) {
22-
int new_capacity = (*capacity) * 2; /* resize */
23-
int *newHeap = (int *)malloc(new_capacity * sizeof(int));
22+
int newCapacity = (*capacity) * 2; /* resize */
23+
int *newHeap = (int *)malloc(newCapacity * sizeof(int));
2424
for (int i = 0; i < *capacity; i++) {
2525
newHeap[i] = (*heap)[i];
2626
}
2727
if (*heap)
2828
free(*heap);
2929
*heap = newHeap;
30-
*capacity = new_capacity;
30+
*capacity = newCapacity;
3131
}
3232
(*heap)[*size] = data;
3333
(*size)++;

0 commit comments

Comments
(0)

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