Asked in Ameyo,SDE

An array A of size m+n is given whose first m elements are filled up with sorted elements. Another array B with size n filled with sorted elements. Now we have to fill all m+n elements of both array in array A in sorted order with only one traversal

AnswerBot
1y

Merge two sorted arrays into one sorted array with one traversal.

  • Use two pointers to track the current elements in arrays A and B.

  • Compare the elements at the current pointers and insert the smaller on...read more

Help your peers!
Add answer anonymously...
Ameyo SDE 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