The operation for removing and returning the front element of the queue is traditionally called:
4 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: "dequeue". Hàng đợi là kiểu vào trước ra trước và cũng có cặp tên truyền thống: enqueue đưa phần tử vào cuối hàng, dequeue lấy phần tử ở đầu hàng ra và trả nó về cho người gọi. Vì vậy "peek" sai vì nó chỉ đọc giá trị ở đầu hàng mà không tháo phần tử nào, số phần tử không giảm đi; "delete" sai vì đó là tên chung của phép xoá, không nói gì tới việc trả giá trị về và cũng không ràng buộc phải xoá ở đầu hàng; "remove" sai vì nó là tên quen thuộc trong các lớp danh sách và tập hợp, nơi ta xoá theo chỉ số hoặc theo giá trị bất kỳ, chứ không phải tên truyền thống của phép lấy khỏi đầu hàng đợi.
Cùng phần 2
Select the statement that is most correct.
Which of the following applications may not use a stack?Có lời giảiCâu hỏiConsider the following pseudocode:
declare a stack of characters
while(there are more characters in the word to read)
{read a character
if a character is '*' then
pop the stack
else
push the character into the stack
}
while(the stack is not empty)
pop and write the poped character to the screen
What is written to the screen for the input "Good**Morn**in***g" ?Có lời giảiCâu hỏiConsider the following pseudocode:
declare a stack of characters
while(there are more characters in the word to read)
{read a character
if a character is '*' then
pop and write the poped character to the screen
else
push the character into the stack
}
What is written to the screen for the input "Good**Morn**i***ng" ?Có lời giảiCâu hỏiCả 51 câu của chủ đề51 câu
Xuất hiện trong 1 bộ đề
Đi tiếp từ đây