I keep getting a segmentation fault with this. Which is probably from the head->data < rightOp.head->data comparison. Also I'am passing in ints not strings. I've never worked with lexicographical comparison and I'm a confused on what it really is. Can anyone explain to me what a lexicographical comparison means? Thanks.
What your lexicographical comparison should do is check the three cases (less than, greater than, equal) for each element of the list.
Starting with the head, and going over the elements:
Is the lhs's element's data < the rhs's element's data? If so, then end with lhs < rhs.
Is the lhs's element's data > the rhs's element's data? If so, then end with lhs > rhs.
The lhs's element's data must == the rhs's element's data. So, move to the next element for each list.
I'm still get a segmentation fault. I'm guessing my if(head-> == rightOp.head->data) return true; isn't working right. I tried returning false, head->next and rightOp.head->next, and just head->next, but none of them "work". Would returning true mean I am moving to the next element in the lists?