Monday 5 March 2012

Data types

http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC1
http://courses.engr.illinois.edu/ece390/books/labmanual/index.html
http://users.ece.utexas.edu/~valvano/embed/chap12/chap12.htm#INSERT // assemly
http://oopweb.com/Algorithms/Files/Algorithms.html
Chương 1:  Đặc trưng về dữ liệu
http://www.cs.cf.ac.uk/Dave/C/CE.html
http://icdrec.edu.vn/en/node/399
http://manhtuan-leo.blogspot.com/2011/05/nhap-xuat-file-trong-c.html
http://www.hvaonline.net/hvaonline/posts/list/4823.hva
http://www.mhschool.com/math/2009/ca/student/grade1/
http://msdn.microsoft.com/en-us/library/system.io.filestream(v=vs.71).aspx
https://docs.google.com/file/d/0BwJqbORuXj3aTEZDclEzXzBEVm8/edit
 1.1 kiểu int



-  xem kiểu dữ liệu sẽ chiếm bao nhiêu byte khi khai bao  sizeof(type)
-  cách biểu diễn một số : binary , hexadecimal , decimal , octal....
----------------- code ---------------------------
#include  <iostream>
using namespace std;
int main()
{
int a[] = {1,5,15,64,-64,255};
cout<< " byte in int :"<< sizeof(int ) <<endl;
cout<< " byte in a[] :"<< sizeof(a ) <<endl;
for(int i =0 ;i <sizeof(a)/sizeof(int ); i++)
{
cout<< "decimal :  "<<dec <<a[i]<<endl;
cout<< "hexadecimal  : "<< hex <<a[i]<<endl;
cout<< "octal  :  "<< oct  <<a[i]<<endl<<endl;
}
 return 0;
}
//--------------------------------------------------
kết quả :
1.1.1 .Unsigned Notation
-Dùng để biểu diễn số lớn hơn không
- Không biểu diễn được số âm
-  khai báo số không dấu   : unsigned type 
     unsigned  char a   ( 8 bits)
     unsigned   short  b ( 16 bits)
     unsigned     int ( Tùy  size của máy  )
// -----------------------code -------------------------
#include  <iostream>
using namespace std;
int main()
{
unsigned int a;
unsigned char b;
unsigned short c;
cout << " unsigned int :" << sizeof(a) <<" bytes"<< endl;
cout << " unsigned char :" << sizeof(b) <<" bytes"<< endl;
cout << " unsigned char :" << sizeof(c) <<" bytes"<< endl;
 return 0;
}
//-----------------------------------------------------------
Kết quả :
1.1.2  Signed-Magnitude Notation
- Dùng để biểu diễn số âm và dương
-  Trong máy tính   không được dùng kiểu dữ liệu này
1.1.3 2’s Complement Notation
- Được dùng trong máy tính để biểu diễn số  nguyên dương và âm
-  0 :  là số dương
- 1 : là số âm
-  số bù 2 ( đảo bit+1)






















1.1.4  Mở rộng kiểu dữ liệu 
Ví dụ khi dữ liệu chuyển đổi từ  8 bits sang 16 bits thì dữ liệu  được biểu diễn như thế nào ?
 + Unsigned
                                       
+ Signed-Magnitude
                  
+2’s Complement 
1.2 Dấu chấm động


 1.3  Kiểu  char
Chương 2 :Giải thuật

Chương 3 : Cấu trúc dữ liệu và tìm kiếm
3.1 mảng - con trỏ và bộ nhớ tĩnh

3.2 cấu trúc dữ liệu


3.2.1 Linked  list


3.2.2 Double  linked list


3.2.3  Stack


3.2.4  Queue


3.2.5 Hash table


3.2.6 Priority Queue


3.2.7 Heap


3.3 Tìm kiếm


3.3.1  Linear   Search


3.3.2  Binary Search


3.4 Sắp Xếp
3.4.1  Bubble sort


3.4.2 Merge sort


3.4.3  insertion sort


3.4.4  Quick sort


3.4 Tree
3.4.1 Binary tree


3.4 .2 AVL tree


3.4.3 Red black tree

3 /tree
Binary Tree


AVL Tree


Red Black Tree




No comments:

Post a Comment