วันจันทร์ที่ 29 มิถุนายน พ.ศ. 2552

DTS02 - 23/06/2552

สรุป
Data Structure
Introduction
1.ความหมายของโครงสร้างข้อมูลข้อมูล
-ข้อมูลคือข้อเท็จจริงต่างๆซึ่งอาจเป็นตัวเลขหรือไม่เป็นตัวเลขก็ได้
-โครงสร้างข้อมูลคือความสัมพันธ์ของสมาชิกในกลุ่ม
2.ประเภทของโครงสร้างข้อมูล แบ่งออกเป็น2ประเภทคือ
1.โครงสร้างข้อมูลทางกายภาพ(Physical Data Structure)
2.โครงสร้างข้อมูลทางตรรกะ(Logical Data Structure)
3.การแทนที่ข้อมูลในหน่วยความจำหลัก มีอยู่2วิธีดังนี้
-การแทนที่ข้อมูลแบบ สแตติก
-การแทนที่ข้อมูลแบบไดนามิก
4.ขั้นตอนวิธี
ขั้นตอนวิธีที่ดีควรมีคุณสมบัติดังนี้
-มีความถูกต้อง
-ใช้เวลาในการปฏิบัติงานน้อยที่สุด
-สั้น กระชับ มีเฉพาะขั้นตอนที่จำเป็นเท่านั้น
-มีความยืดหยุ่นในการใช้งาน
-ใช้เวลาในการพัฒนาน้อยที่สุด
-ง่ายต่อการทำความเข้าใจ


การบ้าน
#include <>
#include <>
int main(void)
{
struct Mytelephone{

char telephone[10];
char generation[70];
char system[70];
char color[70];
char thesystemshakes[70];
float weight;
float high;
float price;

}data;
strcpy(data.telephone,"motorola");
strcpy(data.generation,"RAZR2 V9 Ferrari");
strcpy(data.system,"Quadband DTAC");
strcpy(data.color,"black");
strcpy(data.thesystemshakes,"Vibration in Phone");
data.weight=53;
data.high=103;
data.price=11990;

printf("########################\n");
printf("### Mytelephon ###\n");
printf("########################\n");
printf("telephone : %s\n generation : %s\n system : %s\n color : %s\n thesystemshakes : %s\n weight : %.2f\n high : %d\n price : %.2f\n",data.telephone,data.generation,data.system,data.color,data.thesystemshakes,data.weight,data.high,data.price);
}




ไม่มีความคิดเห็น:

แสดงความคิดเห็น