INTERSECT(p1,p2)
1 answer <----()
2 while p1 not equal Nil and p2 not eqaul Nil
3 do if docId(p1) = docId(p2)
4 then ADD (answer, docId(p1))
5 p1 <--- next(p1)
6 p2 <---- next(p2)
7 else if docId(p1) < docId(p2)
8 then p1<--- next(p1)
9 else p2<--- next(p2)
10 return answer
sobaan30 0 Newbie Poster
Dani 4,329 The Queen of DaniWeb Administrator Featured Poster Premium Member
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.