当前位置:网站首页>Hash tables, sets, maps, trees, heaps, and graphs
Hash tables, sets, maps, trees, heaps, and graphs
2022-06-12 13:41:00 【You stole my name】
One 、 Hashtable 、 mapping 、 aggregate
hash Definition
Hashtable (Hash table), Also called a hash table , According to the key code value (Key value) Data structures that are accessed directly . It accesses records by mapping key values to a location in a table , To speed up the search . This mapping function is called the hash function (Hash Function), The array of records is called a hash table ( Or hash table ).The engineering practice
Telephone directory 、 User information sheet 、 cache (LRU Cache) And key value pair storage (Redis) etc. .hash function

hash Collision

set、map
map yes key-value Yes ,key No repetition ;set: A collection of non repeating elements .
Two 、 Trees 、 Binary tree 、 Binary search tree
Trees and pictures


The list is a special tree , Trees are special graphs
Traversal of binary tree :
1. Before the order (Pre-order): root - Left - Right
2. Middle preface (In-order): Left - root - Right
3. In the following order (Post-order): Left - Right - root
Common traversal algorithms :1. recursive ;2. iteration + Stack .Binary search tree
Binary search tree , Also known as binary sort tree 、 Ordered binary tree (Ordered Binary Tree)、 Sort binary trees (Sorted Binary Tree), An empty tree or a binary tree with the following properties :
1. The value of all nodes in the left subtree is less than the value of its root node ;
2. The value of all nodes in the right subtree is greater than the value of its root node ;
3. And so on : Left 、 Right subtrees are also binary search trees .
In the sequence traversal : Ascending order
3、 ... and 、 Pile and binary pile
- The top of the heap is the maximum or minimum , The biggest one is called the big top pile , The smallest one is called small top pile . The time complexity of finding the best value is O(1).
- Binary heap is realized by complete binary tree , Actually do it with an array . The index for i The left child's index is 2i+1; The index for i The right child's index is 2i+2; The index of the parent node with index is floor((i-1)/2);

边栏推荐
- m1 pod install pod lint 失败解决方案
- Codeforces 1637 E. best pair - Thinking
- 2063: [example 1.4] cattle eat grass
- Symbolic constant, const qualifier
- leetcode 47. Permutations II 全排列 II(中等)
- 智能垃圾桶语音芯片应用设计方案介绍,WT588F02B-8S
- "Non" reliability of TCP
- IC chip scheme fs4062b for lithium battery charging with 5V boost to 12.6V
- 聊聊MySQL的10大经典错误
- [WUSTCTF2020]颜值成绩查询-1
猜你喜欢

当字节跳动在美国输出中国式 996

Web3.0,「激发创造」的时代
![[WUSTCTF2020]颜值成绩查询-1](/img/90/e4c2882357e0a1c6a80f778887e3f5.png)
[WUSTCTF2020]颜值成绩查询-1

D1 哪吒开发板 了解基本的启动加载流程

5V升压到12.6V的锂电池充电IC芯片方案FS4062B

简历 NFT 平台 TrustRecruit 加入章鱼网络成为候选应用链

Innovation training (x) advanced interface beautification

关于#SQLite写注册功能时,数据表查询出错#的问题,如何解决?

Implementing tensorflow deep learning framework similarflow with numpy

Web3.0, the era of "stimulating creativity"
随机推荐
Qt5 plug-in production
import torch_ Geometric first graph network example
leetcode 47. Permutations II 全排列 II(中等)
Rk3399 platform development series explanation (kernel debugging chapter) 2.50 use of systrace
The problem of Joseph in Informatics
1003: align output
618进入后半段,苹果占据高端市场,国产手机终于杀价竞争
[WUSTCTF2020]颜值成绩查询-1
智能垃圾桶语音芯片应用设计方案介绍,WT588F02B-8S
C language implementation of string and memory library functions
VGA display color bar and picture (FPGA)
Overview of embedded system 2- composition and application of embedded system
Encryptor and client authenticate with each other
创新实训(十一)开发过程中的一些bug汇总
Qualcomm platform development series (Protocol) QMI brief introduction and usage
Multi source BFS problem template (with questions)
Octopus network progress monthly report | may 1-May 31, 2022
将字符串转为16进制字符串并显示出来
Top 10 tips for visual studio code on Google
618 entered the second half of the period, apple occupied the high-end market, and the domestic mobile phones finally undercut the price competition