c - How to compare the strings of two linked lists? -


While programming in C, I was able to store words (in the form of forms) in two linked lists which are only one, four nodes are stored, but it is linked to its other characters and thus To make words, I also put a number in the middle to separate words. But I do not know how to get words from linked lists and compare it with all the words (the characters in the other linked list), to see the number of the total number of that word from the previously linked list, the other linked list In .

This is my first time using stack overflow, please accept my apologetic if I have done something wrong.

Thanks for your help

Here's a way.

In the first linked list (call this "List A") in which the word (I 'is called "word w"), for which you are searching, one for the first letter in word w Keep the indicator. At the beginning of the second list (call this "list B"). Declare a counter (this is called "counter x") which tracks the number of word w in the list. Comparison with each list, move through a character of both lists at one time. If you receive two characters in the list that do not match, reset the pointer to the list, return to the beginning of the search term, and leave to begin the next word in List B. If you reach the end of both words, then if you have a match, then the edge counter X. Once you reach the end of List B. You will do it.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -