当前位置:网站首页>MOOC Weng Kai C language week 7: array operation: 1. array operation 2. Search 3. preliminary sorting
MOOC Weng Kai C language week 7: array operation: 1. array operation 2. Search 3. preliminary sorting
2022-07-28 07:03:00 【W.934】
One 、 Array operations
1. Array operations
1. Array operations
In a given set of data , How to find out if a data exists .
2. Positioning during integration initialization
![]()
3. Size of array
sizeof Give the size of the contents occupied by the whole array , Unit is byte .
Number of array elements :sizeof(a)/sizeof(a[0])
sizeof(a[0]) Give the size of a single element in an array ,sizeof(a) Give the array size ; Divide to get the number of cells in the array .
benefits : If the initial data in the array is modified , No need to modify the traversal code .
4. The assignment of an array
Traversal array :
When an array is a function parameter , Often you have to pass in the size of the array with another parameter .
2. Array example : prime number
prime[count++]==i;
Two 、 Search for
1. Linear search
Search for :
2. Two point search
Find numbers in an ordered array
Program :
3、 ... and 、 Sort preliminary
Selection sort
If the array itself is not sorted , To sort by sorting algorithm
边栏推荐
- Archery database audit platform deployment
- Custom component -- pure data field & component life cycle
- DHCP service
- Results fill in the blanks carelessly (violent solution)
- Result number of filled briquettes
- Custom component -- data listener
- QGraphicsView提升为QChartView
- What is a linear table?
- MOOC翁恺 C语言 第三周:判断与循环:1.判断
- Esxi arm edition version 1.10 update
猜你喜欢
随机推荐
Suger Bi create task
Shell script - "three swordsmen" awk command
Test interview questions collection (III) | computer network and database (with answers)
SSH service configuration
Servlet
Results fill in the blanks for beer and drinks
Create, traverse and search nodes as required for single linked list
LNMP搭建过程详解
[learning notes] process creation
[learning notes] tool
Tcp/ip five layer model
[learning notes] coding ability
shell脚本——“三剑客”之awk命令
KVM热迁移
Traversal binary tree
DNS域名解析
Bond mode configuration
Applet creation component
[learning notes] knowledge management
Insertion and deletion of nodes in linked list

















