2 queues q1 and q2 are given.A background process copies elements from q1 to q2.In case an error occurs elements from q2 need to be copied back again to q1.Write this error handling function using foll functions q_len(),q_insert(qname),q_remove(qname,data).q_len() returns int,return type of other functions not known.Also no idea is given regarding the datatype in the queues.(Basically if q1 contains elements 1,2,3,4 and q2 contains 5,6,7 then in case of an error q1 should contain elements 5,6,7,1,2,3,4)

AnswerBot
1y

The error handling function copies elements from q2 back to q1 in case of an error.

  • Use q_len() to get the length of the queues

  • Use q_insert() and q_remove() to manipulate the queues

  • Iterate through q2 a...read more

Help your peers!
Add answer anonymously...
Marvel Realtors Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter