Mar 21, 2002 #1 swaroop Programmer Joined Feb 4, 2001 Messages 100 Location US Some one Please help me. I need a program to Avoid duplication in charector array. Thanks in advance. Swaroop.
Some one Please help me. I need a program to Avoid duplication in charector array. Thanks in advance. Swaroop.
Mar 21, 2002 #2 Zyrenthian Programmer Joined Mar 30, 2001 Messages 1,440 Location US I would think a sorted array would be the best bet, maybe with an insertion sort. Or maybe somethng like char current[128]; char lookFor[2]; memset(lookFor,0,2); lookFor[0]= character; if(!strstr(buffer,lookFor)) { insert it } <Matt Upvote 0 Downvote
I would think a sorted array would be the best bet, maybe with an insertion sort. Or maybe somethng like char current[128]; char lookFor[2]; memset(lookFor,0,2); lookFor[0]= character; if(!strstr(buffer,lookFor)) { insert it } <Matt
Mar 22, 2002 Thread starter #3 swaroop Programmer Joined Feb 4, 2001 Messages 100 Location US Tankyou for your suggession. Upvote 0 Downvote
Apr 20, 2002 #4 jstreich Programmer Joined Apr 20, 2002 Messages 1,067 Location US How about a binary search tree instead? The other way is to spend the time and do the compare on each item. Upvote 0 Downvote
How about a binary search tree instead? The other way is to spend the time and do the compare on each item.