Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Praktika_GruLaIT
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
Container 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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pirahalathan Premachandran
Praktika_GruLaIT
Commits
8d64b220
Commit
8d64b220
authored
1 year ago
by
Pirahalathan Premachandran
Browse files
Options
Downloads
Patches
Plain Diff
Aufgabe 5.3 fertig
parent
94002505
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
w04-2024-ex2-logistics-classification/warehouseUtil.cpp
+13
-4
13 additions, 4 deletions
w04-2024-ex2-logistics-classification/warehouseUtil.cpp
with
13 additions
and
4 deletions
w04-2024-ex2-logistics-classification/warehouseUtil.cpp
+
13
−
4
View file @
8d64b220
...
...
@@ -22,11 +22,13 @@ int getNextIndexToStoreProductTo(int storageArr[], int storageArrSize) {
* is full, return -1.
*/
int
index
=
0
;
while
(
index
)
{
while
(
index
<
storageArrSize
)
{
if
(
storageArr
[
index
]
<=
0
)
{
return
index
;
}
index
++
;
}
return
index
;
return
-
1
;
}
int
findProductIn
(
int
storageArr
[],
int
storageArrSize
,
int
productId
)
{
...
...
@@ -34,5 +36,12 @@ int findProductIn(int storageArr[], int storageArrSize, int productId) {
* It should return the first occurrence of a given product id.
* If the id is not found, it should return -1.
*/
int
idx
=
0
;
while
(
idx
<
storageArrSize
)
{
if
(
storageArr
[
idx
]
==
productId
)
{
return
idx
;
}
idx
++
;
}
return
-
1
;
}
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