queue get_common_elements(queue &XX,queue &XX){ XXXXX XXXXXX; XXX size1=XX.size(); XXX XXXXX=XX.size(); XXX(int i=0;i XX; XX.XXXX(X); XX.push(2); q1.XXXX(X); XX.push(4); XX.XXXX(X); queue XX; q2.XXXX(-1); XX.XXXX(X); q2.XXXX(7); q2.XXXX(5); q2.XXXX(10); cout &XX;&XX; "Before XXXXXXXX common XXXXXXXX: " << XXXX; cout &XX;&XX; "XXXXX-X: "; print_queue(q1); cout &XX;< "XXXXX-2: "; XXXXXXXXXXX(XX); cout &XX;&XX; XXXX; XXXXX XXXXXX=XXXXXXXXXXXXXXXXXXX(q1,q2); XXXX <&XX; "XXXXX XXXXXXXX XXXXXX XXXXXXXX: " &XX;< XXXX; cout &XX;< "XXXXX-1: "; XXXXXXXXXXX(XX); XXXX &XX;< "XXXXX-X: "; XXXXXXXXXXX(XX); XXXX << XXXX; XXXX &XX;&XX; "XXXXXX XXXXXXXX: "; XXXXXXXXXXX(XXXXXX); return 0;}
Sample XXXXXX
XXXXXX removing common XXXXXXXX: Queue-X: X 2 3 4 5 Queue-2: -X 2 7 X 10 XXXXX removing common XXXXXXXX: XXXXX-X: XXX Queue-2