The elements of an array are stored successively in memory cells because
2 phương ánCó giải thích
Các phương án trả lời
Chọn một phương ánLời giảiChọn phương án để mở
Đáp án đúng: "by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated". Nhờ các phần tử nằm liên tiếp và mỗi phần tử chiếm đúng cùng số byte, địa chỉ của phần tử thứ i tính được bằng địa chỉ đầu cộng i nhân kích thước một phần tử, nên truy cập theo chỉ số mất thời gian hằng số và chương trình chỉ cần lưu một địa chỉ gốc. Phương án "the architecture of computer memory does not allow arrays to store other than serially" quy việc đó cho phần cứng, nhưng bộ nhớ hoàn toàn cho phép lưu rời rạc: danh sách liên kết và cây để các nút rải rác khắp vùng nhớ rồi nối nhau bằng con trỏ. Lưu liên tiếp là một lựa chọn thiết kế để đổi lấy phép tính địa chỉ, chứ không phải điều kiện bắt buộc của kiến trúc.
Cùng phần 1
Suppose a doubly linked list of integers is given below and p is a reference to the node with value 30 in the list (i.e. p.info=30):
(head) 7 11 6 4 30 9 8 2 (tail)
What does the list look like after the following java code snippet is run?
Node p1,p2; p1 = p.next;
p2 = p1.next;
p.next = p2;
if(p2!=null) p2.prev=p;Có lời giảiCâu hỏiSuppose a doubly linked list of integers is given below and p is a reference to the node with value 13 in the list (i.e. p.info=13):
(head) 7 11 6 4 32 13 8 2 (tail)
What does the list look like after the following java code snippet is run?
int x = 17;
Node q = new Node(x);
q.prev=null;
q.next = head;
head.prev = q;
head = q;Có lời giảiCâu hỏiSelect the statement that is most correct.
Basically, the complexity of getting an element at the middle of a singly linked lists isCó lời giảiCâu hỏiCả 64 câu của chủ đề64 câu
Xuất hiện trong 1 bộ đề
Đi tiếp từ đây