📄 test_redblacktree.m
字号:
% // ==================================
% // test program
% // ==================================
function test_RedBlackTree
nodelist= [11,4,8,14,17,6,9,7,16,15,13,5,19,18,12,10,3,20,1];
root = RedBlackTree(2);
for n=nodelist
root.insert(n)
end
% class implementing the NodeVisitor interface
v=NodeVisitor;
fprintf('M = ');
root.inorder(v,0);
fprintf('\n');
% find the specified element and print its value
x=root.find(16);
fprintf([x.s '\n']);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -