r.sachdeva9355
BAN USERvoid removeSpaces(char str[],int size)
{
int i=0,j = size-1;
char temp;
while(i<j)
{
while(str[i] != ' ')
{
i++;
}
while(str[j] == ' ' )
{
j--;
}
if(i<j)
{
temp = str[i];
str[i] = str[j];
str[j] = temp;
}
}
str[i+1] = "\0";
}
We can't modify the list.
Neither do we actually have to reverse the linked list. We just need to print in a reverse order.
Exactly!
A node can point to only one other node!
The pointers will surely meet and more precisely, in a way that the distance between the "pointers and the start of the loop" and the "head and the start of the loop" will be the same.
- r.sachdeva9355 August 07, 2012What exactly does "may or may not start from the head mean" ??
We certainly cannot backtrack in a singly linked list unless its circular.
Maybe i am not clear with the question. Please explain.
I think its C
- r.sachdeva9355 July 31, 2012
- r.sachdeva9355 December 23, 2012