Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
examen_prog_2_2023
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
antoine.giles
examen_prog_2_2023
Commits
29157297
Commit
29157297
authored
2 years ago
by
antoine.giles
Browse files
Options
Downloads
Patches
Plain Diff
ca free pas, liste est considérée comme nulle
parent
fbb0605c
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
ex3/main
+0
-0
0 additions, 0 deletions
ex3/main
ex3/main.c
+11
-10
11 additions, 10 deletions
ex3/main.c
ex3/main.o
+0
-0
0 additions, 0 deletions
ex3/main.o
with
11 additions
and
10 deletions
ex3/main
0 → 100755
+
0
−
0
View file @
29157297
File added
This diff is collapsed.
Click to expand it.
ex3/main.c
+
11
−
10
View file @
29157297
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#include
<stdbool.h>
#include
<stdbool.h>
typedef
struct
element
{
typedef
struct
element
{
in
t
data
;
floa
t
data
;
struct
element
*
next
;
struct
element
*
next
;
struct
element
*
prev
;
struct
element
*
prev
;
}
element
;
}
element
;
...
@@ -27,20 +27,20 @@ element* dll_push(element* head, int data){
...
@@ -27,20 +27,20 @@ element* dll_push(element* head, int data){
head
->
prev
=
new
;
head
->
prev
=
new
;
new
->
next
=
head
;
new
->
next
=
head
;
}
}
printf
(
"created element with data = %
d
\n
"
,
new
->
data
);
printf
(
"created element with data = %
f
\n
"
,
new
->
data
);
return
new
;
return
new
;
}
}
void
dll_print
(
element
*
head
){
void
dll_print
(
element
*
head
){
/*
if(dll_empty){
if
(
dll_empty
){
printf
(
"list is empty
\n
"
);
printf
(
"list is empty
\n
"
);
return
;
return
;
}
*/
}
while
(
head
->
next
!=
NULL
){
while
(
head
->
next
!=
NULL
){
printf
(
"%
d
->"
,
head
->
data
);
printf
(
"%
f
->"
,
head
->
data
);
head
=
head
->
next
;
head
=
head
->
next
;
}
}
printf
(
"%
d
"
,
head
->
data
);
printf
(
"%
f
\n
"
,
head
->
data
);
}
}
void
dll_destroy
(
element
*
head
){
void
dll_destroy
(
element
*
head
){
...
@@ -59,19 +59,20 @@ int main(){
...
@@ -59,19 +59,20 @@ int main(){
printf
(
"entrez la liste "
);
printf
(
"entrez la liste "
);
int
length
=
0
;
int
length
=
0
;
scanf
(
"%d"
,
&
length
);
scanf
(
"%d"
,
&
length
);
in
t
*
tab
=
malloc
(
length
*
sizeof
(
in
t
));
floa
t
*
tab
=
malloc
(
length
*
sizeof
(
floa
t
));
for
(
int
i
=
0
;
i
<
length
;
i
++
){
for
(
int
i
=
0
;
i
<
length
;
i
++
){
scanf
(
"%
d
"
,
&
tab
[
i
]);
scanf
(
"%
f
"
,
&
tab
[
i
]);
}
}
element
*
lst1
=
dll_create
();
element
*
lst1
=
dll_create
();
for
(
int
i
=
0
;
i
<
length
;
i
++
){
for
(
int
i
=
0
;
i
<
length
;
i
++
){
lst1
=
dll_push
(
lst1
,
tab
[
i
]);
lst1
=
dll_push
(
lst1
,
tab
[
i
]);
if
(
lst1
->
next
!=
NULL
){
if
(
lst1
->
next
!=
NULL
){
printf
(
"lst1->next->data = %d
\n
"
,
lst1
->
next
->
data
);
printf
(
"lst1->next->data = %f
\n
"
,
lst1
->
next
->
data
);
}
}
}
}
dll_print
(
lst1
);
dll_destroy
(
lst1
);
dll_destroy
(
lst1
);
...
...
This diff is collapsed.
Click to expand it.
ex3/main.o
0 → 100644
+
0
−
0
View file @
29157297
File added
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