السلام عليكم ...
اقتباسFor the List class, add a Boolean-valued function that determines whether the data items in the linked list are arranged in ascending order.
بعد اذنكم اريد معرفة كيف اعمل هذه الفنكشن بالـ recursion :
bool list::isOrdered() const
{
Node *ptr = first; Node *following;
bool isOrdered = true;
if(mysize >=2 )
{
following = ptr->next;
while (following !=Null && isOrdered)
{isOrdered=(ptr->data->following->data);
ptr=following;
following = following->next;}
}
return isOrdered;
}اريد ان افهم فكرة عمل ال recursion وكيف يمكني تطبيقها على الفنكشن السابقة ...