Professional Documents
Culture Documents
Slide B Tree
Slide B Tree
NODE
DATA
DISK BLOCK
SIZE
ƯU NHƯỢC ĐIỂM
B Tree tự cân bằng. Chậm hơn các cấu trúc tìm kiếm khác
(Hash table) với dữ liệu nhỏ.
Bậc 5 (m = 5)
10 20 30 40 50
CHÈN NODE
Tạo cây BTtree [10, 20, 30, 40, 50]
Bậc 5 (m = 5)
10 20 30 40 50
CHÈN NODE
Tạo cây BTtree [10, 20, 30, 40, 50]
Bậc 5 (m = 5)
30
10 20 40 50
DUYỆT CÂY
● Duyệt qua và in ra tất cả khóa theo thứ tự
tăng dần
● Nếu là lá thì in các khóa và kết thúc
● Duyệt node con [0] rồi in khóa [0]
● ...
● Duyệt node con [m-1] rồi in khóa [m-1]
● Duyệt node con [m]
TÌM KIẾM
● Bắt đầu từ gốc.
● Với mỗi node trung gian:
○ Nếu trong node này có khóa cần tìm, trả về kết quả.
○ Nếu không, duyệt xuống node con ngay trước khóa lớn hơn
đầu tiên.
● Nếu duyệt đến node lá mà không có khóa cần tìm, trả về
NULL.
TÌM KIẾM
Tìm node 50, 240.
XÓA
○ Thiếu khóa: chuyền node con sang node bên cạnh, ○ Thiếu khóa: lấy khóa gần nhất
nếu không được thì lấy khóa gần nhất ở node con, của node cha
nếu không lấy được thì gộp 2 node con, nếu còn
thiếu thì tiếp tục lấy ở node cha ○ Thừa khóa: đẩy khóa ở giữa lên
node cha, tách làm 2
○ Thừa khóa: đẩy khóa ở giữa lên node cha, tách làm
2
ỨNG DỤNG &
B+TREE 02
B+ TREE
Các khóa ở tầng ngay Các node lá có toàn bộ Các node lá liên kết với
trên tầng lá là khóa nhỏ các khóa trong cây nhau thành 1 danh sách
nhất của lá bên phải liên kết
CHÈN TRONG B+ TREE
Khi node lá đầy, tách node lá thành 2 tại vị trí và thêm
khóa thứ vào node cha. Nếu node cha đầy thì xử lí như B-
Tree
XÓA TRONG B+ TREE
○ Sau khi xóa, nếu cây cần cân bằng thì lấy một khóa ○ Xử lí tương tự nhưng khi xóa khóa
ở node bên cạnh, nếu không lấy được thì gộp node ở lá thì xóa luôn ở node cha chứa
hiện tại với node bên cạnh. khóa đó.
○ Các tầng trên xử lí như B-Tree. ○ Nếu node không ghép thì thêm tiếp
theo khóa đã xóa vào node cha
SO SÁNH VỚI B TREE
Với mỗi khóa, index trỏ tới địa chỉ dữ liệu trong
một bảng
INDEXING
Với mỗi khóa, index trỏ tới địa chỉ dữ liệu trong
một bảng
INDEXING TRONG DBMS
INDEXING TRONG DBMS
B TREE TRONG INDEXING
THANK youremail@freepik.com
+91 620 421 83
yourcompany.com
S
CREDITS: This presentation template was created by Slidesgo, including
icons by Flaticon, and infographics & images by Freepik
Please keep this slide for attribution
ádccf?
MARS NEPTUNE
Despite being red, It’s the farthest planet
Mars is a cold place from the Sun
JUPITER SATURN
It’s the biggest planet in Saturn is the ringed
the Solar System one and a gas giant
MAIN COMPETITORS
NEPTUNE
It’s the farthest planet from
the Sun
MARS
Despite being red, Mars is
a cold place
VENUS
Venus is the second planet
from the Sun
SATURN
It’s composed mostly of
hydrogen and helium
MARKET RESEARCH
NEPTUNE
It’s the farthest planet
from the Sun
MERCURY
Mercury is the closest
planet to the Sun
SATURN
Saturn is composed of
hydrogen and helium
ANALYSIS
OUTREACH TOP RATED
VALUES
20-39 80%
40-60 50%
500,000
75% Female
+
Employees
60% Male
A Picture Is Worth a
Thousand Words
AWESOME
WORDS
OUR PROCESS
JANE DOE
You can replace the image on the
screen with your own
“This is a quote. Words full of
wisdom that someone important
said and can make the reader get
inspired.”
—SOMEONE
FAMOUS
OUR PARTNERS
SATURN MERCURY
Saturn is composed Mercury is the
mostly of hydrogen closest planet to the
and helium Sun
TESTIMONIALS
“Mercury is the closest planet “Venus has a beautiful name “Jupiter is a gas giant and the
to the Sun and the smallest of and is the second planet from biggest planet in the Solar
them all” the Sun” System”
—HENRY
—RYAN DIXON —ALIYA FARLEY McKANE
“Saturn is composed mostly “The Sun is the star at the “Neptune is the fourth-largest
of hydrogen and helium” center of the Solar System” planet in the Solar System”
VECTORS PHOTOS
● Abstract pixel rain blue background ● Female colleagues discussing work at office
● Dashboard element collection ● Close-up confident adult woman posing
● Red and blue neon fingerprint background ● Portrait of beautiful adult woman smiling
● Dashboard element collection template
Instructions for use
In order to use this template, you must credit Slidesgo by keeping the Thanks slide.
For more information about editing slides, please read our FAQs or visit Slidesgo School:
https://slidesgo.com/faqs and https://slidesgo.com/slidesgo-school
Fonts & colors used
This presentation has been made using the following fonts:
Share Tech
(https://fonts.google.com/specimen/Share+Tech)
Maven Pro
(https://fonts.google.com/specimen/Maven+Pro)
PHASE 1
Task 1
Task 2
PHASE 2
Task 1
Task 2
PHASE
1
Task 1
Task 2
...and our sets of editable icons
You can resize these icons without losing quality.
You can change the stroke and fill color; just select the icon and click on the paint bucket/pen.
In Google Slides, you can also use Flaticon’s extension, allowing you to customize and add even more icons.
Educational Icons Medical Icons
Business Icons Teamwork Icons
Help & Support Icons Avatar Icons
Creative Process Icons Performing Arts Icons
Nature Icons
SEO & Marketing Icons