Problem1426--Self-printable B+ Tree

1426: Self-printable B+ Tree

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

In this project, you are supposed to implement a B+ tree of order 3, with the following operations: initialize, insert (with splitting) and search. The B+ tree should be able to print out itself.

Input

Each input file contains one test case. For each case, the first line contains a positive number N (≤10​4​​), the number of integer keys to be inserted. Then a line of the N positive integer keys follows. All the numbers in a line are separated by spaces.

Output

Each input file contains one test case. For each case, the first line contains a positive number N (≤10​4​​), the number of integer keys to be inserted. Then a line of the N positive integer keys follows. All the numbers in a line are separated by spaces.

Sample Input Copy

6
7 8 9 10 7 4

Sample Output Copy

Key 7 is duplicated
[9]
[4,7,8][9,10]

Source/Category