Linkedlist with stack


i have 2 linked lists. i add the values into the list by stack implementation. Here is the point. if there any numbers which equals to each other, program will print "yes" otherwise, will print "no".

and i have to chech this in o(n) time. by the way i made push and pop operators by functions, not from the library.

could you tell me any idea to do that ?

for example if my lists are like this:

List1: 1-2-4-5
List2: 3-7-8-2

program will print "yes"
Topic archived. No new replies allowed.