Answer:
Create two pointers, each set to the start of the list. Update each as follows:
while (pointer1) {
pointer1 = pointer1->next;
pointer2 = pointer2->next; if (pointer2) pointer2=pointer2->next;
if (pointer1 == pointer2) {
print ("circularn");
}
}
Thus, these are the most commonly asked Infosys technical interview questions. Read these Infosys technical interview questions for better Interview process.
while (pointer1) {
pointer1 = pointer1->next;
pointer2 = pointer2->next; if (pointer2) pointer2=pointer2->next;
if (pointer1 == pointer2) {
print ("circularn");
}
}
Thus, these are the most commonly asked Infosys technical interview questions. Read these Infosys technical interview questions for better Interview process.
Previous Question | Next Question |
What is DLL in Infosys? | Can you please explain the difference between foreign key and reference key? |