Algorithm for reversing a linked list in C++:
- Initialize three pointers, prev, curr, and next.
- Set prev to NULL, curr to head of the linked list, and next to head->next.
- Iterate through the list using a while loop, where the condition is that curr is not equal to NULL.
- In each iteration, set curr->next to prev and update prev to curr and curr to next.
- If next is not equal to NULL, set next to next->next.
- Finally, set head of the linked list to prev.
This algorithm has a time complexity of O(n) and a space complexity of O(1), where n is the number of nodes in the linked list. It is an efficient algorithm for reversing a linked list in C++.