一個計算機系教授的上課講義 主要是教導學生使用C語言編寫程序

源代码在线查看: 14.txt

软件大小: 93 K
上传用户: zhangchao0219
关键词: 程序
下载地址: 免注册下载 普通下载 VIP

相关代码

				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 
				#define SIZE 14
				int key[ ] = {
					1101, 1102, 1103, 1104, 1107, 
					1108, 1109, 1110, 1201, 1203, 
					1207, 1210, 1213, 1215
				};
				char* company[ ] = {
					"			

相关资源