数据结构与算法(7)--查找

在前面,我们已经学习到了线性表,树,图等常见的数据结构,而今天我们主要考虑非常常用的一种应用–查找,指在某种数据结构上找出满足给定条件的数据元素, 又称 检索 , 是数据处理中常见的重要操作,我们需要了解不同查找方法,性能分析,适用问题,
查找方法: 顺序查找,折半查找,分块查找,二叉查找树,AVL树查找

1.查找定义,分类


在这里插入图片描述
1.线性查找


所谓“哨兵”就是用一个特殊值来作为数组的边界,使用“哨兵”可以少用一条判断语句(少了i<n这句),所以可以提高程序的效率

2.折半查找



3.分块查找

在这里插入图片描述
4.二叉树



5. AVL树
平衡树,是二叉树的升级




平衡树还有一个更大升级—B树(在这里不多做介绍)
6. 接下来是散列方法

在这里插入图片描述






在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
PHP 7 Data Structures and Algorithms by Mizanur Rahman English | 6 Jun. 2017 | ASIN: B01IF7NLDW | 340 Pages | AZW3 | 2.55 MB Key Features Gain a complete understanding of data structures using a simple approach Analyze algorithms and learn when you should apply each solution Explore the true potential of functional data structures Book Description PHP has always been the the go-to language for web based application development, but there are materials and resources you can refer to to see how it works. Data structures and algorithms help you to code and execute them effectively, cutting down on processing time significantly. If you want to explore data structures and algorithms in a practical way with real-life projects, then this book is for you. The book begins by introducing you to data structures and algorithms and how to solve a problem from beginning to end using them. Once you are well aware of the basics, it covers the core aspects like arrays, listed lists, stacks and queues. It will take you through several methods of finding efficient algorithms and show you which ones you should implement in each scenario. In addition to this, you will explore the possibilities of functional data structures using PHP and go through advanced algorithms and graphs as well as dynamic programming. By the end, you will be confident enough to tackle both basic and advanced data structures, understand how they work, and know when to use them in your day-to-day work What you will learn Gain a better understanding of PHP arrays as a basic data structure and their hidden power Grasp how to analyze algorithms and the Big O Notation Implement linked lists, double linked lists, stack, queues, and priority queues using PHP Work with sorting, searching, and recursive algorithms Make use of greedy, dynamic, and pattern matching algorithms Implement tree, heaps, and graph algorithms Apply PHP functional data structures and built-in data structures and algorithms About the Autho
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值