Res = ifMember (ptr, S2); /* Check membership of ptr in S2 */
if (Res == 0)
{flag = 0;
break;
}
ptr = NEXT (ptr);
}
if (flag == 0) {prompt “not equal”; exit ();}
ptr = S2;
while (ptr != Null)
{
Res = ifMember (ptr, S1); /* Check membership of ptr in S1 */
if (Res == 0)
{flag = 0;
break;
}
ptr = NEXT (ptr);
}
if (flag == 0) {prompt “not equal”; exit ();}
else
prompt “Sets Equal”;
}
Note: The ifMember() function is already defined in the previous section. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.