mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-04 12:12:45 +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:
@@ -5,7 +5,7 @@
|
||||
const std = @import("std");
|
||||
const inc = @import("include");
|
||||
|
||||
// Driver Code
|
||||
// 実行用コード
|
||||
pub fn main() !void {
|
||||
// 二分木を初期化する
|
||||
// ノードを初期化する
|
||||
@@ -14,24 +14,24 @@ pub fn main() !void {
|
||||
var n3 = inc.TreeNode(i32){ .val = 3 };
|
||||
var n4 = inc.TreeNode(i32){ .val = 4 };
|
||||
var n5 = inc.TreeNode(i32){ .val = 5 };
|
||||
// ノード間の参照(ポインタ)を構築する
|
||||
// ノード間の参照(ポインタ)を設定する
|
||||
n1.left = &n2;
|
||||
n1.right = &n3;
|
||||
n2.left = &n4;
|
||||
n2.right = &n5;
|
||||
std.debug.print("二分木を初期化\n", .{});
|
||||
std.debug.print("二分木を初期化する\n", .{});
|
||||
try inc.PrintUtil.printTree(&n1, null, false);
|
||||
|
||||
// ノードの挿入と削除
|
||||
var p = inc.TreeNode(i32){ .val = 0 };
|
||||
// n1 -> n2 の間にノード P を挿入
|
||||
// n1 -> n2 の間にノード P を挿入する
|
||||
n1.left = &p;
|
||||
p.left = &n2;
|
||||
std.debug.print("ノード P を挿入した後\n", .{});
|
||||
std.debug.print("ノード P の挿入後\n", .{});
|
||||
try inc.PrintUtil.printTree(&n1, null, false);
|
||||
// ノードを削除
|
||||
// ノードを削除する
|
||||
n1.left = &n2;
|
||||
std.debug.print("ノード P を削除した後\n", .{});
|
||||
std.debug.print("ノード P の削除後\n", .{});
|
||||
try inc.PrintUtil.printTree(&n1, null, false);
|
||||
|
||||
_ = try std.io.getStdIn().reader().readByte();
|
||||
|
||||
Reference in New Issue
Block a user