Thông tin tài nguyên

ĐÁNH GIÁ CÁC GIAO THỨC CÂY TRUY VẤN DỰA TRÊN TRI THỨC VỚI CÁC PHÂN BỐ THẺ RFID KHÁC NHAU

hue-hujos-tt-8158.pdf · Phiên bản 1 · 17 trang

18
Bản gốc
Trang 9 · Đoạn 17Vị trí nguồn

jos.hueuni.edu.vn Tập 134, Số 2A, 2025 117 2. do InsertNode (T, tid) for each tid of all possible tags in database // Chèn từng thẻ trong CSDL 3. procedure InsertNode(T: tree, tid: tag ID) 4. if T is null then 5. create new n as the root node of T with nS = tid // Tạo nút gốc T 6. directly end procedure 7. else 8. n ← the root node of T; l ← the length of nS // n: gốc T, l: |nS| 9. k ← the length of common prefix nS and tid // Độ dài tiền tố chung 10. if k < l then 11. m ← new node values and sub-nodes of n // m: nút mới từ n 12. mS ← different part of nS against tid // mS là phần khác nhau 13. nS ← common prefix nS against tid // nS là tiền tố chung 14. nV ← nV + 1 if n is leaf node // Tăng nV nếu n là lá 15. clear the child nodes of n // Xóa các nút con của n 16. if first bit of mS is ‘0’ then // Bit đầu của mS = '0' 17. set m as left sub-node of n // Đặt m là nút con trái của n 18. elseif first bit of mS is ‘1’ then // Bit đầu của mS = '1' 19. set m as right sub-node of n // Đặt m là nút con phải của n 20. end 21. end 22. nV ← nV + 1 23. dif_t ← different part of tid against nS // dif_t là phần khác nhau 24. if first bit of dif_t is ‘0’ then // Bit đầu dif_t = '0' 25. InsertNode(left sub-tree of n, dif_t) // Đệ quy cây con trái 26. elseif first bit of dif_t is ‘1’ then // Bit đầu dif_t = '1' 27. InsertNode(right sub-tree of n, dif_t) // Đệ quy cây con phải 28. end 29. end 30. end identification procedure 1. level ← -1 // Khởi tạo level 2. Transmit the command starting a frame // Bắt đầu khung