mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-04 04:02:48 +08:00
Retranslate the complete Japanese online edition from Chinese (#2008)
* Retranslate the complete Japanese online edition from Chinese * Fit Japanese homepage labels and localize heading permalinks * Point Japanese contribution instructions to the Japanese preview * Replace locale conditionals with multilingual UI tables
This commit is contained in:
@@ -8,12 +8,12 @@ use hello_algo_rust::include::print_util;
|
||||
|
||||
use std::collections::VecDeque;
|
||||
|
||||
/* Driver Code */
|
||||
/* 実行用コード */
|
||||
pub fn main() {
|
||||
// キューを初期化
|
||||
// キューを初期化する
|
||||
let mut queue: VecDeque<i32> = VecDeque::new();
|
||||
|
||||
// 要素をエンキュー
|
||||
// 要素をエンキューする
|
||||
queue.push_back(1);
|
||||
queue.push_back(3);
|
||||
queue.push_back(2);
|
||||
@@ -22,20 +22,20 @@ pub fn main() {
|
||||
print!("キュー queue = ");
|
||||
print_util::print_queue(&queue);
|
||||
|
||||
// キュー先頭の要素にアクセス
|
||||
// キューの先頭要素にアクセス
|
||||
let peek = queue.front().unwrap();
|
||||
println!("\n先頭要素 peek = {peek}");
|
||||
println!("\nキューの先頭要素 peek = {peek}");
|
||||
|
||||
// 要素をデキュー
|
||||
// 要素をデキューする
|
||||
let pop = queue.pop_front().unwrap();
|
||||
print!("取り出した要素 pop = {pop}、取り出し後 queue = ");
|
||||
print!("デキューした要素 pop = {pop}、デキュー後 queue = ");
|
||||
print_util::print_queue(&queue);
|
||||
|
||||
// キューの長さを取得
|
||||
let size = queue.len();
|
||||
print!("\nキューの長さ size = {size}");
|
||||
|
||||
// キューが空かどうかを判定
|
||||
// キューが空か判定
|
||||
let is_empty = queue.is_empty();
|
||||
print!("\nキューが空かどうか = {is_empty}");
|
||||
print!("\nキューは空か = {is_empty}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user