The overall code is good.
c struct Node { int data; struct Node* next; };
/* Function to get the middle of the linked list */ void printMiddle(struct Node *head) { struct Node *slow_ptr = head; struct Node *fast_ptr = head;
if (head != NULL)
{
while (fast_ptr != NULL && fast_ptr->next != NULL)
{
fast_ptr = fast_ptr->next->next;
slow_ptr = slow_ptr->next;
}
printf("The middle element is [%d]\n\n", slow_ptr->data);
}
}
Print the middle of a linked list
c struct Node { int data; struct Node* next; };
/* Function to get the middle of the linked list */ void printMiddle(struct Node *head) { struct Node *slow_ptr = head; struct Node *fast_ptr = head;
if (head != NULL)
{
while (fast_ptr != NULL && fast_ptr->next != NULL)
{
fast_ptr = fast_ptr->next->next;
slow_ptr = slow_ptr->next;
}
printf("The middle element is [%d]\n\n", slow_ptr->data);
}
}
The following metrics were computed from 27 interview experiences for the Cisco Senior Software Engineer role in Bengaluru, Karnataka.
Cisco's interview process for their Senior Software Engineer roles in Bengaluru, Karnataka is on the easier side as most engineers get an offer after going through it.
Candidates reported having very good feelings for Cisco's Senior Software Engineer interview process in Bengaluru, Karnataka.