⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 14.txt

📁 一個計算機系教授的上課講義 主要是教導學生使用C語言編寫程序
💻 TXT
字号:
CS 1355
Introduction to Programming in C
Thursday 2006.10.24 (Week 7)
Lecture notes (at http://r638-2.cs.nthu.edu.tw/C/notes/14.txt)

Chapter 6: Arrays (continued)

- search: linear vs binary search
- multiple-subscripted arrays

What is "search"
- look up a data record using a "key"
- what is a key? 
  example: name, student ID, product number etc.
- input: key
- output: data record, or "not found"

Linear Search:
- go through array from beginning, 
  as soon as we find a match, return.

Example:
#include <stdio.h>
#define SIZE 14
int key[ ] = {
	1101, 1102, 1103, 1104, 1107, 
	1108, 1109, 1110, 1201, 1203, 
	1207, 1210, 1213, 1215
};
char* company[ ] = {
	"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -