
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 an integer array sorted in ascending order, write a function to search
target
innums
. Iftarget
exists, then return its index, otherwise return-1
. However, the array size is unknown to you. You may only access the array using anArrayReader
interface, whereArrayReader.get(k)
returns the element of the array at indexk
(0-indexed).You may assume all integers in the array are less than
10000
, and if you access the array out of bounds,ArrayReader.get
will return2147483647
.Example 1:
Example 2:
Note:
[-9999, 9999]
.这道题给了我们一个未知大小的数组,让我们在其中搜索数字。给了我们一个ArrayReader的类,我们可以通过get函数来获得数组中的数字,如果越界了的话,会返回整型数最大值。既然是有序数组,又要搜索,那么二分搜索法肯定是不二之选,问题是需要知道数组的首尾两端的位置,才能进行二分搜索,而这道题刚好就是大小未知的数组。所以博主的第一个想法就是先用二分搜索法来求出数组的大小,然后再用一个二分搜索来查找数字,这种方法是可以通过OJ的。但其实我们是不用先来确定数组的大小的,而是可以直接进行搜索数字,我们实际上是假设数组就有整型最大值个数字,在多余的位置上相当于都填上了整型最大值,那么这也是一个有序的数组,我们可以直接用一个二分搜索法进行查找即可,参见代码如下:
类似题目:
Binary Search
类似题目:
https://leetcode.com/problems/search-in-a-sorted-array-of-unknown-size/
https://leetcode.com/problems/search-in-a-sorted-array-of-unknown-size/discuss/171669/Straight-forward-binary-search.
https://leetcode.com/problems/search-in-a-sorted-array-of-unknown-size/discuss/151685/Shortest-and-cleanest-Java-solution-so-far...
LeetCode All in One 题目讲解汇总(持续更新中...)
The text was updated successfully, but these errors were encountered: