---
title: "关于查找算法(The more the better)"
author: "swimmer2000"
date: "2009-04-24T13:51:00Z"
tags: []
slug: "the-more-the-better"
draft: false
lastmod: "2009-08-07T15:13:31Z"
id: 441486
url: "https://swimmer2000.iteye.com/blog/441486"
---

线性查找的时间复杂度为n。如果我们知道数组是已排好了序的，那么就可以采用更有效率的算法，例如二分查找法，它的时间复杂度为lgn。其实我是想说，对问题知道得越多（有序数组中相邻的元素是递增的关系，而在一般的数组中，我们不知道相邻的数组元素谁大谁小），我们就越能找出更有效的解决方案。近似于说教了，真失败。