** Please help me out, I\'m trying to study for my final and this question is a
ID: 3660689 • Letter: #
Question
** Please help me out, I'm trying to study for my final and this question is a practice example to prepare myself for the final **
This problem is about the Queue ADT and about differences in object semantics and parameter passing in Java and C++. In the following programs assume that both Java and C++ have a generic template Qu class with the operations en (short for enqueue), deQ (short for de queue), front, and isEmpty, with the usual meanings. Show the output for each of the following two programs that look roughly the "same" in C++ and Java. Show your answer for a program to the right of that program. Note: the C++ function uses pass by-reference Java program public class MainClass public static void my Func (Queue Integer a, Queue Integer b) f a de public static void main (string a ras Queue Integer s ne w Queue Integer s enQ (3) s enQ (4) Queue Integer t ne w Queue Integer t.enQ (9) t.enQ (7) System. out pri ntln (s. front t. front my Eun. c s, t); System. out. pri ntln (s. front t front C++ program. NOTE: uses pass by-reference void my Fun c (Queue int & a Queue int & b) a deo int main Que int> s; enQ (3) enQ (4) Queue int t; t.enQ (9) t.enQ (7) cout s ront t front endl my Func (s, t) cout s front t. front end l;Explanation / Answer
it print 1->2->3->1->2->3->1->2->3-> and so on. its a circular Link list
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.