CoderMJLee/BinaryTrees — 319★ trên GitHub (JavaScript). Some operations for binary tree
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
public final class BinaryTrees {
// 打印一棵二叉树
public static void print(BinaryTreeInfo tree);
public static void print(BinaryTreeInfo tree, PrintStyle style);
// 打印一棵二叉树(打印完自动换行)
public static void println(BinaryTreeInfo tree);
public static void println(BinaryTreeInfo tree, PrintStyle style);
// 获得一棵二叉树的打印字符串
public static String printString(BinaryTreeInfo tree);
public static String printString(BinaryTreeInfo tree, PrintStyle style);
// 可选的打印样式
public enum PrintStyle {
LEVEL_ORDER,
INORDER
}
}
示例(Example)
先实现BinaryTreeInfo的相关操作(Implements BinaryTreeInfo)
根节点是谁?(Who is the root node?)
如何查找左节点?(How to get the left child?)
如何查找右节点?(How to get the right child?)
如何打印单个节点?(How to print a node?)
/**
* BinarySearchTree是你自己编写的二叉树类
* BinarySearchTree is a binary tree class that is created by yourself.
*/
public class BinarySearchTree<E> implements BinaryTreeInfo {
/**这里省略了大量代码,只贴出了脉络代码**/
/** only show some main code **/
private Node<E> root;
private static class Node<E> {
E element;
Node<E> left;
Node<E> right;
}
/********** BinaryTreeInfo **********/
@Override
public Object root() {
// 根节点是谁?
// who is the root node?
return root;
}
@Override
public Object left(Object node) {
// 如何查找左节点?
// how to get the left child of the node?
return ((Node)node).left;
}
@Override
public Object right(Object node) {
// 如何查找右节点?
// how to get the right child of the node?
return ((Node)node).right;
}
@Override
public Object string(Object node) {
// 如何打印单个节点?
// how to print the node?
return ((Node)node).element;
}
/********** BinaryTreeInfo **********/
}
CoderMJLee/BinaryTrees có 319 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/CoderMJLee/BinaryTrees. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
CoderMJLee/BinaryTrees có những chủ đề gì?
GitHub topics của CoderMJLee/BinaryTrees: "binary-search-tree", "binary-tree". TopGit xếp repo vào nhóm mã nguồn mở.
CoderMJLee/BinaryTrees có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho CoderMJLee/BinaryTrees. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
CoderMJLee/BinaryTrees còn đang phát triển không?
Commit gần nhất trên CoderMJLee/BinaryTrees là 9 tháng trước (theo timestamp GitHub). Repo có 68 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
CoderMJLee/BinaryTrees dùng license gì?
CoderMJLee/BinaryTrees phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
CoderMJLee/BinaryTrees viết bằng ngôn ngữ gì?
CoderMJLee/BinaryTrees chủ yếu viết bằng JavaScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc thêm về CoderMJLee/BinaryTrees ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/CoderMJLee/BinaryTrees là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về BinaryTrees?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về BinaryTrees.