Skip to content

Commit 14dea47

Browse files
authored
array updated
1 parent 1e49f2d commit 14dea47

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Array/22 Missing elements in Unsorted Array (HASH TABLE).cpp

+16
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@ struct Array {
88
int size;
99
int length;
1010
};
11+
int Min(struct Array* arr) {
12+
int min = INT_MAX;
13+
for (int i = 0; i < arr->length; i++) {
14+
if (arr->A[i] < min)
15+
min = arr->A[i];
16+
}
17+
return min;
18+
}
19+
20+
int Max(struct Array* arr) {
21+
int max = INT_MIN;
22+
for (int i = 0; i < arr->length; i++)
23+
if (arr->A[i] > max)
24+
max = arr->A[i];
25+
return max;
26+
}
1127
void Missingelemet_Hash_table(struct Array* arr) {
1228
int* H;
1329
int i;

0 commit comments

Comments
 (0)