
Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
History is littered with hundreds of conflicts over the future of a community, group, location or business that were "resolved" when one of the parties stepped ahead and destroyed what was there. With the original point of contention destroyed, the debates would fall to the wayside. Archive Team believes that by duplicated condemned data, the conversation and debate can continue, as well as the richness and insight gained by keeping the materials. Our projects have ranged in size from a single volunteer downloading the data to a small-but-critical site, to over 100 volunteers stepping forward to acquire terabytes of user-created data to save for future generations.
The main site for Archive Team is at archiveteam.org and contains up to the date information on various projects, manifestos, plans and walkthroughs.
This collection contains the output of many Archive Team projects, both ongoing and completed. Thanks to the generous providing of disk space by the Internet Archive, multi-terabyte datasets can be made available, as well as in use by the Wayback Machine, providing a path back to lost websites and work.
Our collection has grown to the point of having sub-collections for the type of data we acquire. If you are seeking to browse the contents of these collections, the Wayback Machine is the best first stop. Otherwise, you are free to dig into the stacks to see what you may find.
The Archive Team Panic Downloads are full pulldowns of currently extant websites, meant to serve as emergency backups for needed sites that are in danger of closing, or which will be missed dearly if suddenly lost due to hard drive crashes or server failures.
Given two sorted integer arrays nums1 and nums2 , merge nums2 into nums1 as one sorted array.
Note:
Example:
混合插入有序数组,由于两个数组都是有序的,所有只要按顺序比较大小即可。题目中说了 nums1 数组有足够大的空间,说明不用 resize 数组,又给了m和n,那就知道了混合之后的数组的大小,这样就从 nums1 和 nums2 数组的末尾开始一个一个比较,把较大的数,按顺序从后往前加入混合之后的数组末尾。需要三个变量 i,j,k,分别指向 nums1,nums2,和混合数组的末尾。进行 while 循环,如果i和j都大于0,再看如果 nums1[i] > nums2[j],说明要先把 nums1[i] 加入混合数组的末尾,加入后k和i都要自减1;反之就把 nums2[j] 加入混合数组的末尾,加入后k和j都要自减1。循环结束后,有可能i或者j还大于等于0,若j大于0,那么还需要继续循环,将 nums2 中的数字继续拷入 nums1。若是i大于等于0,那么就不用管,因为混合数组本身就放在 nums1 中,参见代码如下:
解法一:
我们还可以写的更简洁一些,将两个 while 循环融合到一起,只要加上 i>=0 且 nums1[i] > nums2[j] 的判断条件,就可以从 nums1 中取数,否则就一直从 nums2 中取数,参见代码如下:
解法二:
Github 同步地址:
#88
类似题目:
Merge Sorted Array
Merge Two Sorted Lists
Squares of a Sorted Array
Interval List Intersections
参考资料:
https://leetcode.com/problems/merge-sorted-array/
https://leetcode.com/problems/merge-sorted-array/discuss/29572/My-simple-solution
https://leetcode.com/problems/merge-sorted-array/discuss/29515/4ms-C%2B%2B-solution-with-single-loop
LeetCode All in One 题目讲解汇总(持续更新中...)
The text was updated successfully, but these errors were encountered: