Select the statement that is most correct. Which of the following applications may not use a stack?
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: "Multi-programming.". Đa chương trình là bài toán của hệ điều hành: nhiều tiến trình cùng chờ CPU và được chọn theo lát thời gian hoặc theo độ ưu tiên, nên cấu trúc phù hợp là hàng đợi hoặc hàng đợi ưu tiên với kỷ luật vào trước ra trước, trái hẳn với kỷ luật vào sau ra trước của ngăn xếp; điều phối theo kiểu ngăn xếp sẽ bỏ đói tiến trình đến sớm nhất. "Evaluating arithmetic expressions." đúng là việc của ngăn xếp: đổi trung tố sang hậu tố cần một ngăn xếp toán tử để so độ ưu tiên, còn tính biểu thức hậu tố cần ngăn xếp toán hạng, lấy hai phần tử trên đỉnh mỗi khi gặp toán tử. "Undo sequence in a text editor." cũng vậy: thao tác vừa làm phải được hoàn tác trước nhất, đúng thứ tự vào sau ra trước. "Keeping track of local variables at run time." chính là mô tả của ngăn xếp lời gọi: mỗi lần gọi hàm đẩy thêm một khung chứa biến cục bộ, hàm trả về thì lấy khung trên đỉnh ra.
Cùng phần 2
Consider 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ỏiConsider the following pseudocode:
declare a queue of characters
while(there are more characters in the word to read)
{read a character
if a character is '*' then
dequeue and write the dequeued character to the screen
else
enqueue the character into the queue
}
What is written to the screen for the input "HowAre***You**To****Day" ?Có lời giảiCâu hỏiSuppose we are implementing a stack of Integers using a singly linked list where the head of the list is treated as the top of the stack.
Specify the correct implementation of push() method of the stack. (Choose the most suitable one)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