Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
generic
|
||||
type Element_Type is private;
|
||||
package Container is
|
||||
type Tree is tagged private;
|
||||
procedure Replace_All(The_Tree : in out Tree; New_Value : Element_Type);
|
||||
private
|
||||
type Node;
|
||||
type Node_Access is access Node;
|
||||
type Tree tagged record
|
||||
Value : Element_type;
|
||||
Left : Node_Access := null;
|
||||
Right : Node_Access := null;
|
||||
end record;
|
||||
end Container;
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package body Container is
|
||||
procedure Replace_All(The_Tree : in out Tree; New_Value : Element_Type) is
|
||||
begin
|
||||
The_Tree.Value := New_Value;
|
||||
If The_Tree.Left /= null then
|
||||
The_Tree.Left.all.Replace_All(New_Value);
|
||||
end if;
|
||||
if The_tree.Right /= null then
|
||||
The_Tree.Right.all.Replace_All(New_Value);
|
||||
end if;
|
||||
end Replace_All;
|
||||
end Container;
|
||||
Loading…
Add table
Add a link
Reference in a new issue