Open mihai511 opened 5 years ago
void search_min_heap(struct min_heap root, int searched_value){ struct min_heap current;
current = root;
if ( (current != NULL) && (current->data == searched_value) ){
found = 1;
printf("\nDa!\n");
return;
}else{
if(current->left != NULL)
search_min_heap(current->left, searched_value);
if(current->right != NULL)
search_min_heap(current->right, searched_value);
}
}
Daca dupa ordonarea array-ului initial numarul din arr[n] ramane tot in pozitia arr[n], cand il voi cauta, functia imi va spune ca nu exista si nu imi dau seama de ce.
Folosisem BST si nu trebuie in acest caz, my bad.