Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OOP2024-AMP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Uwe Wienkop
OOP2024-AMP
Commits
9f0bfa13
Commit
9f0bfa13
authored
10 months ago
by
Uwe Wienkop
Browse files
Options
Downloads
Patches
Plain Diff
DoubleLinked, BinTree
parent
beddf116
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
OOP2024_AMP.sln
+6
-0
6 additions, 0 deletions
OOP2024_AMP.sln
P10 BinTree/P10 BinTree.csproj
+11
-0
11 additions, 0 deletions
P10 BinTree/P10 BinTree.csproj
P10 BinTree/Program.cs
+75
-0
75 additions, 0 deletions
P10 BinTree/Program.cs
with
92 additions
and
0 deletions
OOP2024_AMP.sln
+
6
−
0
View file @
9f0bfa13
...
@@ -21,6 +21,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "P08 CycleList", "P08 CycleL
...
@@ -21,6 +21,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "P08 CycleList", "P08 CycleL
EndProject
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "P09 DoubleLinkedList", "P09 DoubleLinkedList\P09 DoubleLinkedList.csproj", "{700D8B3A-C742-4E1C-A550-33730D987C57}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "P09 DoubleLinkedList", "P09 DoubleLinkedList\P09 DoubleLinkedList.csproj", "{700D8B3A-C742-4E1C-A550-33730D987C57}"
EndProject
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "P10 BinTree", "P10 BinTree\P10 BinTree.csproj", "{CE6BBA02-59C6-4A56-9867-1F49C451CFBB}"
EndProject
Global
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Any CPU = Debug|Any CPU
...
@@ -63,6 +65,10 @@ Global
...
@@ -63,6 +65,10 @@ Global
{700D8B3A-C742-4E1C-A550-33730D987C57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{700D8B3A-C742-4E1C-A550-33730D987C57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{700D8B3A-C742-4E1C-A550-33730D987C57}.Release|Any CPU.ActiveCfg = Release|Any CPU
{700D8B3A-C742-4E1C-A550-33730D987C57}.Release|Any CPU.ActiveCfg = Release|Any CPU
{700D8B3A-C742-4E1C-A550-33730D987C57}.Release|Any CPU.Build.0 = Release|Any CPU
{700D8B3A-C742-4E1C-A550-33730D987C57}.Release|Any CPU.Build.0 = Release|Any CPU
{CE6BBA02-59C6-4A56-9867-1F49C451CFBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CE6BBA02-59C6-4A56-9867-1F49C451CFBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE6BBA02-59C6-4A56-9867-1F49C451CFBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE6BBA02-59C6-4A56-9867-1F49C451CFBB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
HideSolutionNode = FALSE
...
...
This diff is collapsed.
Click to expand it.
P10 BinTree/P10 BinTree.csproj
0 → 100644
+
11
−
0
View file @
9f0bfa13
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>P10_BinTree</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
This diff is collapsed.
Click to expand it.
P10 BinTree/Program.cs
0 → 100644
+
75
−
0
View file @
9f0bfa13
namespace
P10_BinTree
{
class
BTree
{
class
LItem
{
public
int
number
;
public
LItem
?
left
=
null
,
right
=
null
;
public
LItem
(
int
number
)
{
this
.
number
=
number
;
}
public
void
Print
()
{
left
?.
Print
();
Console
.
Write
(
$"
{
number
}
- "
);
right
?.
Print
();
}
}
LItem
?
root
=
null
;
public
void
Add
(
int
number
)
{
LItem
?
neu
=
new
LItem
(
number
);
if
(
root
==
null
)
root
=
neu
;
else
{
var
tmp
=
root
;
while
(
true
)
{
if
(
number
<
tmp
.
number
)
// gehört die Zahl auf die linke Seite?
{
if
(
tmp
.
left
==
null
)
// linker Parkplatz frei?
{
tmp
.
left
=
neu
;
break
;
}
else
tmp
=
tmp
.
left
;
}
// analog für die rechte Seite
else
{
if
(
tmp
.
right
==
null
)
// rechter Parkplatz frei?
{
tmp
.
right
=
neu
;
break
;
}
else
tmp
=
tmp
.
right
;
}
}
}
}
public
void
Print
()
{
root
?.
Print
();
}
}
class
Program
{
static
void
Main
(
string
[]
args
)
{
BTree
bt
=
new
BTree
();
bt
.
Add
(
50
);
bt
.
Add
(
30
);
bt
.
Add
(
70
);
bt
.
Add
(
60
);
bt
.
Add
(
50
);
bt
.
Add
(
65
);
bt
.
Print
();
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment