The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of storing pointer to any type as it is a generic pointer type.
Vijay.
ReplyDeleteThanks for posting your collection of interview questions and solutions. They have helped me clarify a number of concepts and prepare for technical interviews.
It really helps to read your entire approach and learn how you arrive at a particular solution.
Keep up the great work. And once again, Thanks.
very helpful dude...its good to find all the good questions at one place..
ReplyDeleteVery useful questions and answeres.
ReplyDeleteThanks for providing everything together
very good robert very good
ReplyDeleteFundoo questions and answers - thanks a lot for posting such a wonderful collection. BTW - a bit more explanation to few question will be more useful (e.g. generic link list ).
ReplyDeletefsdfs
ReplyDelete#include stdio.h
ReplyDeletevoid trim1(char s[]);
int main()
{
char str1[]=" Hello I am Good ";
clrscr();
printf("\n\nBefore trimming : [%s]", str1);
printf("\n\nAfter trimming "); trim1(str1);
getch();
return 0;
}
void trim1(char s[])
{
char ps[50];
int i,j=0;
for (i=0; s[i] != '\0'; i++)
{
if (!isspace(s[i]))
{
ps[j++] = s[i];
}
}
ps[j] = '\0';
printf("[ ");
for(j=0;j<-strlen(ps);j++)
printf("%c",ps[j]);
printf(" ]");
}
without using pointer in trim function
ReplyDeletethanks a lot for posting such a good collection of questions, I really appreciate the effort you have put in.
ReplyDeleteRegards
Thanks a lot for all your effort, I have referred o your blog every time I prepare for interviews. Thanks again for your effort, I appreciate that.
ReplyDelete