matematykaszkolna.pl
Przepisanie funkcji rekurencyjnej iteracyjnie Mariusz: struct node* SortedMerge(struct node* a, struct node* b) { struct node* result = NULL; /* Base cases */ if (a == NULL) return(b); else if (b==NULL) return(a); /* Pick either a or b, and recur */ if (a−>data <= b−>data) { result = a; result−>next = SortedMerge(a−>next, b); } else { result = b; result−>next = SortedMerge(a, b−>next); } return(result); } Jak przepisać tę funkcję rekurencyjną do postaci iteracyjnej Dodatkowo można by wywalić obecnie zwracaną wartość do listy parametrów aby móc z tego zrobić procedurę czyli funkcję typu void
19 gru 00:52