<< Chapter < Page Chapter >> Page >

Tổng quan

Mục tiêu

Sau khi học xong chương này, sinh viên cần phải nắm:

  • Khái niệm về đối tượng dữ liệu, biến, hằng.
  • Khái niệm về kiểu dữ liệu.
  • Các phương pháp kiểm tra kiểu và biến đổi kiểu.

Nội dung cốt lõi

  • Các khái niệm về đối tượng dữ liệu, kiểu dữ liệu.
  • Sự khai báo các đối tượng dữ liệu trong chương trình.
  • Kiểm tra kiểu, biến đổi kiểu dữ liệu.
  • Vấn đề gán giá trị và khởi tạo biến.

Kiến thức cơ bản cần thiết

Kiến thức và kĩ năng lập trình căn bản

Ðối tượng dữ liệu

Khái niệm đối tượng dữ liệu

Trong máy tính thực dữ liệu được lưu trữ ở bộ nhớ trong và bộ nhớ ngoài. Trong đó dữ liệu được tổ chức thành các bit, các byte hoặc word. Tuy nhiên trong máy tính ảo của một NNLT nào đó, dữ liệu có tổ chức phức tạp hơn với các mảng, ngăn xếp, số, chuỗi ký tự ...

Người ta sử dụng thuật ngữ đối tượng dữ liệu (ÐTDL) để chỉ một nhóm của một hoặc nhiều mẩu dữ liệu trong máy tính ảo.

Khác với tính chất tĩnh tương đối của các vùng nhớ trong máy tính thực, các ÐTDL và các mối liên hệ nội tại của chúng lại thay đổi một cách động trong quá trình thực hiện chương trình.

Các loại ðtdl

Xét về mặt cấu trúc thì người ta phân ÐTDL làm hai loại là ÐTDL sơ cấp và ÐTDL có cấu trúc hay cấu trúc dữ liệu.

ÐTDL sơ cấp là một ÐTDL chỉ chứa một giá trị dữ liệu đơn. Hẳng hạn như một số, một kí tự,…

ĐTDL có cấu trúc hay cấu trúc dữ liệu là một tích hợp của các ÐTDL khác. Mỗi ĐTDL thành phần của ĐTDL có cấu trúc được gọi là một phần tử. Mỗi phần tử của cấu trúc dữ liệu có thể là một ÐTDL sơ cấp hay cũng có thể là một ÐTDL có cấu trúc khác. Ví dụ một chuỗi kí tự, một tập hợp các số, một véctơ, một ma trận,…đều là các ĐTDL có cấu trúc.

Xét về mặt nguồn gốc thì có thể phân ÐTDL làm hai loại: ÐTDL tường minh và ÐTDL ẩn.

ÐTDL tường minh là một ÐTDL do người lập trình tạo ra chẳng hạn như các biến, các hằng,… được người lập trình viết ra trong chương trình.

ÐTDL ẩn là một ĐTDL được định nghĩa bởi hệ thống như các ngăn xếp lưu trữ các giá trị trung gian, các mẩu tin kích hoạt chương trình con, các ô nhớ đệm của tập tin... Các ÐTDL này được phát sinh một cách tự động khi cần thiết trong quá trình thực hiện chương trình và người lập trình không thể truy cập đến chúng được.

Thuộc tính của ðtdl

Thuộc tính của một ĐTDL là một tính chất đặc trưng của ĐTDL đó.

Mỗi ÐTDL có một tập hợp các thuộc tính để phân biệt ĐTDL này với ĐTDL khác.

Các ĐTDL sơ cấp chỉ có một thuộc tính duy nhất là kiểu dữ liệu của đối tượng đó. Các ĐTDL có cấu trúc có thêm các thuộc tính nhằm xác định số lượng, kiểu dữ liệu của các phần tử và các thuộc tính khác.

Giá trị dữ liệu

Giá trị dữ liệu (GTDL) của một ĐTDL sơ cấp có thể là một số, một ký tự hoặc là một giá trị logic tùy thuộc vào kiểu của ĐTDL đó.

Mỗi GTDL thường được biểu diễn bởi một dãy các bit trong bộ nhớ của máy tính.

Cần phân biệt hai khái niệm ÐTDL và GTDL. Một ÐTDL luôn luôn được biểu diễn bởi một khối ô nhớ trong bộ nhớ của máy tính trong khi một GTDL được biểu diễn bởi một dãy các bit. Khi nói rằng một ÐTDL A chứa một GTDL B có nghĩa là: khối ô nhớ biểu diễn cho A chứa dãy bit biểu diễn cho B.

Questions & Answers

how does Neisseria cause meningitis
Nyibol Reply
what is microbiologist
Muhammad Reply
what is errata
Muhammad
is the branch of biology that deals with the study of microorganisms.
Ntefuni Reply
What is microbiology
Mercy Reply
studies of microbes
Louisiaste
when we takee the specimen which lumbar,spin,
Ziyad Reply
How bacteria create energy to survive?
Muhamad Reply
Bacteria doesn't produce energy they are dependent upon their substrate in case of lack of nutrients they are able to make spores which helps them to sustain in harsh environments
_Adnan
But not all bacteria make spores, l mean Eukaryotic cells have Mitochondria which acts as powerhouse for them, since bacteria don't have it, what is the substitution for it?
Muhamad
they make spores
Louisiaste
what is sporadic nd endemic, epidemic
Aminu Reply
the significance of food webs for disease transmission
Abreham
food webs brings about an infection as an individual depends on number of diseased foods or carriers dully.
Mark
explain assimilatory nitrate reduction
Esinniobiwa Reply
Assimilatory nitrate reduction is a process that occurs in some microorganisms, such as bacteria and archaea, in which nitrate (NO3-) is reduced to nitrite (NO2-), and then further reduced to ammonia (NH3).
Elkana
This process is called assimilatory nitrate reduction because the nitrogen that is produced is incorporated in the cells of microorganisms where it can be used in the synthesis of amino acids and other nitrogen products
Elkana
Examples of thermophilic organisms
Shu Reply
Give Examples of thermophilic organisms
Shu
advantages of normal Flora to the host
Micheal Reply
Prevent foreign microbes to the host
Abubakar
they provide healthier benefits to their hosts
ayesha
They are friends to host only when Host immune system is strong and become enemies when the host immune system is weakened . very bad relationship!
Mark
what is cell
faisal Reply
cell is the smallest unit of life
Fauziya
cell is the smallest unit of life
Akanni
ok
Innocent
cell is the structural and functional unit of life
Hasan
is the fundamental units of Life
Musa
what are emergency diseases
Micheal Reply
There are nothing like emergency disease but there are some common medical emergency which can occur simultaneously like Bleeding,heart attack,Breathing difficulties,severe pain heart stock.Hope you will get my point .Have a nice day ❣️
_Adnan
define infection ,prevention and control
Innocent
I think infection prevention and control is the avoidance of all things we do that gives out break of infections and promotion of health practices that promote life
Lubega
Heyy Lubega hussein where are u from?
_Adnan
en français
Adama
which site have a normal flora
ESTHER Reply
Many sites of the body have it Skin Nasal cavity Oral cavity Gastro intestinal tract
Safaa
skin
Asiina
skin,Oral,Nasal,GIt
Sadik
How can Commensal can Bacteria change into pathogen?
Sadik
How can Commensal Bacteria change into pathogen?
Sadik
all
Tesfaye
by fussion
Asiina
what are the advantages of normal Flora to the host
Micheal
what are the ways of control and prevention of nosocomial infection in the hospital
Micheal
what is inflammation
Shelly Reply
part of a tissue or an organ being wounded or bruised.
Wilfred
what term is used to name and classify microorganisms?
Micheal Reply
Binomial nomenclature
adeolu
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Cấu trúc dữ liệu. OpenStax CNX. Jul 29, 2009 Download for free at http://cnx.org/content/col10766/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Cấu trúc dữ liệu' conversation and receive update notifications?

Ask