Lập trình Java cơ bản : Collections part 5

Collections Framework • Các collection đầu tiên của Java: • Mảng • Vector: Mảng động • Hastable: Bảng băm • Collections Framework (từ Java ) • Là một kiến trúc hợp nhất để biểu diễn và thao tác trên các collection. • Giúp cho việc xử lý các collection | Binary Search Tree Ví dụ về Binary Search Tree 47 25 Cài đặt Binary Search Tree public class TreeNode int data TreeNode leftNode rightNode public TreeNode int nodeData data nodeData leftNode rightNode null public void insert int value if value data if leftNode null leftNode new TreeNode value else value else if value data if rightNode null rightNode new TreeNode value else value Cài đặt Binary Search Tree public class Tree private TreeNode root public Tree root null public void insertNode int insertValue if root null root new TreeNode insertValue else insertValue public void preorderTraversal preorder root

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
4    333    2    29-04-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.