Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我有两个数组,
A= [2,3,4] and B=[8,9,10].
我怎样才能合并这两个数组。
Solution C=[2,3,4,8,9,10]
请指导。
如果您的意思是合并并保留某种顺序,则遍历 A 和 B 同时将下一个相关(取决于您的排序标准)值复制到新数组中的下一个插槽中。