Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stack
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
algorithmique
lib_2021_malaspinas
stack
Compare revisions
287ed7af4c3d024a95e7870fdd5dbd637e3b7f0e to f39dc138bcfadba4c904ce8d3645218401161981
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
algorithmique/lib_2021_malaspinas/stack
Select target project
No results found
f39dc138bcfadba4c904ce8d3645218401161981
Select Git revision
Swap
Target
algorithmique/lib_2021_malaspinas/stack
Select target project
algorithmique/lib_2021_malaspinas/stack
1 result
287ed7af4c3d024a95e7870fdd5dbd637e3b7f0e
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Resolve "Add is empty function"
· 3126857e
orestis.malaspin
authored
3 years ago
3126857e
Merge branch '10-add-is-empty-function' into 'main'
· f39dc138
orestis.malaspin
authored
3 years ago
Resolve "Add is empty function" Closes
#10
See merge request
!19
f39dc138
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
stack.c
+13
-0
13 additions, 0 deletions
stack.c
stack.h
+1
-1
1 addition, 1 deletion
stack.h
with
14 additions
and
1 deletion
stack.c
View file @
f39dc138
#include
<stdlib.h>
#include
<stdlib.h>
#include
<stdbool.h>
#include
<stdio.h>
#include
"stack.h"
#include
"stack.h"
...
@@ -75,3 +78,13 @@ int get_length(stack s) {
...
@@ -75,3 +78,13 @@ int get_length(stack s) {
return
s
.
top
+
1
;
return
s
.
top
+
1
;
}
}
/**
* @brief Check if a stack is empty
*
* @param s
* @return bool - true if stack is empty, false otherwise
*/
bool
stack_is_empty
(
stack
s
)
{
return
s
.
top
==
-
1
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
stack.h
View file @
f39dc138
#ifndef _STACK_H_
#ifndef _STACK_H_
#define _STACK_H_
#define _STACK_H_
typedef
struct
_stack
{
typedef
struct
_stack
{
int
*
data
;
int
*
data
;
int
capacity
;
int
capacity
;
...
@@ -17,6 +16,7 @@ void stack_pop(stack *s, int *value);
...
@@ -17,6 +16,7 @@ void stack_pop(stack *s, int *value);
void
stack_peek
(
stack
s
,
int
*
value
);
void
stack_peek
(
stack
s
,
int
*
value
);
void
stack_clone
(
stack
s
,
stack
*
clone
);
void
stack_clone
(
stack
s
,
stack
*
clone
);
int
get_length
(
stack
s
);
int
get_length
(
stack
s
);
bool
stack_is_empty
(
stack
s
);
void
stack_print
(
const
stack
s
);
void
stack_print
(
const
stack
s
);
...
...
This diff is collapsed.
Click to expand it.