精确线性搜索与回溯搜索
Suppose you use Uber application as a rider and you request a ride to go from one place to another. Your driver just arrived at the parking lot of your place. The only thing you know about the ride is the license plate number. How do you find your Uber ride?
假设您使用Uber应用程序作为骑手,并且您请求将骑车从一个地方转到另一个地方。 您的司机刚到达您所在地的停车场。 您唯一了解的是车牌号。 您如何找到自己的Uber乘车路线?
The obvious thing is to go to the parking lot and search all the cars one by one. This method of searching is called linear search, where we search for all possible options (brute force search) until we get our desired result. We follow linear search in our daily life such as while finding a specific book, medicine or movie in stores.
显而易见的事情是去停车场,一个接一个地搜索所有汽车。 这种搜索方法称为线性搜索,其中我们搜索所有可能的选项(蛮力搜索),直到获得所需的结果。 我们在日常生活中进行线性搜索,例如在商店中查找特定书籍,药品或电影。
Going back to Uber example, let’s consider parki