Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tri
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
lucas.toniutti
Tri
Commits
8717f355
Commit
8717f355
authored
4 years ago
by
lucas.toniutti
Browse files
Options
Downloads
Patches
Plain Diff
finalisation
parent
1d334031
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
executable
+0
-0
0 additions, 0 deletions
executable
main.c
+9
-3
9 additions, 3 deletions
main.c
main.o
+0
-0
0 additions, 0 deletions
main.o
tri.c
+1
-1
1 addition, 1 deletion
tri.c
tri.o
+0
-0
0 additions, 0 deletions
tri.o
with
10 additions
and
4 deletions
executable
deleted
100755 → 0
+
0
−
0
View file @
1d334031
File deleted
This diff is collapsed.
Click to expand it.
main.c
+
9
−
3
View file @
8717f355
...
...
@@ -5,6 +5,10 @@ bool desc(int32_t a, int32_t b){
return
a
<
b
;
}
bool
asc
(
int32_t
a
,
int32_t
b
)
{
return
a
>
b
;
}
int
main
(){
int
size
=
15
;
int32_t
array
[
size
];
...
...
@@ -12,13 +16,15 @@ int main(){
for
(
int32_t
i
=
0
;
i
<
size
;
i
++
)
{
array
[
i
]
=
rand
()
%
100
;
}
for
(
int
i
=
0
;
i
<
size
;
i
++
){
printf
(
"%4d
\n
"
,
array
[
i
]);
}
printf
(
"//////////////
\n
"
);
triBulle
(
sorted
,
array
,
size
,
desc
);
triBulle
(
sorted
,
array
,
size
,
asc
);
//Affiche tableau trié
for
(
int
i
=
0
;
i
<
size
;
i
++
){
printf
(
"%4d
\n
"
,
sorted
[
i
]);
}
...
...
This diff is collapsed.
Click to expand it.
main.o
deleted
100644 → 0
+
0
−
0
View file @
1d334031
File deleted
This diff is collapsed.
Click to expand it.
tri.c
+
1
−
1
View file @
8717f355
...
...
@@ -9,7 +9,7 @@ void triBulle(int32_t sorted[], const int32_t *const orig, int32_t nitems, bool
for
(
int
i
=
nitems
-
1
;
i
>=
1
;
i
--
){
for
(
int
j
=
0
;
j
<=
i
-
1
;
j
++
){
//Décroissant <
if
(
sorted
[
j
]
<
sorted
[
j
+
1
]){
if
(
comp
(
sorted
[
j
]
,
sorted
[
j
+
1
])
)
{
tmp
=
sorted
[
j
];
sorted
[
j
]
=
sorted
[
j
+
1
];
sorted
[
j
+
1
]
=
tmp
;
...
...
This diff is collapsed.
Click to expand it.
tri.o
deleted
100644 → 0
+
0
−
0
View file @
1d334031
File deleted
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