is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
Recursive:
- cprof.pv1990 December 19, 20131) Divide the list in two parts - first node and rest of the linked list.
2) Call reverse for the rest of the linked list.
3) Link rest to first.
4) Fix head pointer
void recursiveReverselinkedlist(struct node** head)
{
struct node* first_node;
struct node* rest_nodes;
/* empty list */
if (*head == NULL)
return;
first_node = *head;
rest_nodes = first_node->next;
/* List has only one node */
if (rest_nodes == NULL)
return;
/* reverse the rest list and put the first element at the end */
recursiveReverse(&rest_nodes);
first_node->next->next = first_node;
first_node->next = NULL;
*head = rest_nodes;
}
Time Complexity: O(n)
Space Complexity: O(1)