TAILIEUCHUNG - Algorithms and Networking for Computer Games phần 10

Tổng quát của mô tả của một thuật toán sau từ trừu tượng hóa thích hợp, đó là lý do tại sao chúng tôi đã trừu tượng hóa cấu trúc dữ liệu cho bộ sưu tập dữ liệu cơ bản như bộ, bản đồ và đồ thị. Để truy cập vào dữ liệu từ các bộ sưu tập dữ liệu, chúng tôi sử dụng thói quen nguyên thủy và trừu tượng lập chỉ mục. | PSEUDO-CODE CONVENTIONS 237 1 V Average S 2 case V of 3 error empty V undefined Unexpected situation S 0. 4 end case Data Structures Generality of the description of an algorithm follows from proper abstractions which is why we have abstracted data structures to fundamental data collections such as sets mappings and graphs. For accessing data from these data collection we use primitive routines and indexing abstractions. Values and entities The simplest datum is a value. Apart from the constants false true and nil we can define other literals for special purposes. A value is a result of an expression and can be stored to a variable. The values in the pseudo-code notation do not imply any particular implementation. For example nil can be realized using a null pointer the integer value -1 or a sentinel object. Values can be aggregated so that they form the attributes of an entity. These attributes can be accessed through primitive routines. For example to define an entity e with physical attributes we can attach primitive routines location e size e and weight e to it. Because an attribute concerns only the entity given as an argument the attribute can also be assigned. For example to make e weightless we can assign weight e 0. If an entity is implemented as a software record or an object the attributes are natural candidates for member variables and the respective get and set member functions. Data collections A collection imposes relationships between its entities. Instead of listing all the commonly used data structures we take a minimalist approach and use only a few general collections. A collection has characteristic attributes and it provides query operations. Moreover it can be modified if it is a local structure in an algorithm. The elements of a data structure must be initialized and an element that has not been given a value cannot be evaluated. Sets The simplest collection of entities or values is a set. The members of a set are unique .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.