how to merge an integer queue and character queue... based on their same position using deque.. give logic in java
Answers
Answered by
0
Answer:
I don't use java but there is the python code to merge an integer queue and character queue
Explanation:
- q1_max = len(q1)
- q2_max = len(q2)
- dif = q2_max - q1_max
- i = 0
- res_out = ''
- while i < q1_max:
- res_out += str(q1[i]) + ',' + q2[i] + ','
- i += 1
- while dif < q2_max:
- res_out += q2[dif] + ','
- dif += 1
- print(res_out)
Similar questions