Computer Science, asked by anilamanalil1289, 4 months ago

how to merge an integer queue and character queue... based on their same position using deque.. give logic in java​

Answers

Answered by mjeystech
0

Answer:

I don't use java but there is the python code to merge an integer queue and character queue

Explanation:

  1. q1_max = len(q1)
  2. q2_max = len(q2)
  3. dif = q2_max - q1_max
  4. i = 0
  5. res_out = ''
  6. while i < q1_max:
  7. res_out += str(q1[i]) + ',' + q2[i] + ','
  8. i += 1
  9. while dif < q2_max:
  10. res_out += q2[dif] + ','
  11. dif += 1
  12. print(res_out)
Similar questions