Others
Assessment
CenterForComputing
ChatGPT
Search
Close
Log in
Register
CenterForComputing
You are here:
CenterForComputing
»
Syllabi
»
CSC121SylF2023
»
CSC121F2023Lab11
»
CSC121F2023Lab11Hint1
Algorithm for placing one item
05 Mar 2024 - 19:05
|
Version
1
|
UnknownUser
This algorithm should be sent the 2D array and one item.
Assume there there is space available
Start with the 0'th ship
While there is space, you have not placed the item, and you have not checked every ship
Start with the 0'th container on the current ship
While it is not placed and you have not checked every container on the current ship
If there is room
place it
indicate that you found where to place it
otherwise go to the next container
if need be go to the next ship
if never placed that means there was no room
Attachments
($count)
Show options
Search:
Sort by:
Name
Date
Author
Size
Type
Results per page:
6
12
24
48
all
Display hidden:
More actions
Create link(s)
Embed
Download
Hide
Unhide
Move
Delete
0
attachment(s)
Select all
Clear all
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki?
Send feedback
This website is using cookies.
More info
.
That's Fine