grep -r --include="*.h" "text_you_want_to_searh" ./ - used to search text_you_want_to_searh in all *.h recursively
Most computations on a list will require O(N) time complexity, so a simple but very useful technique is to pass through the list a constant number of times to calculate some summary of the list that will simplify your algorithm. One example that we see a lot is the need to calculate the length of the list. That sounds simple enough, but let's see an example to motivate this technique better.
Let's take a look at this common problem as defined in Intersection of Two Linked Lists.
Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists:
A: a1 → a2
↘