Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
26
Task/Queue-Usage/PowerShell/queue-usage-1.psh
Normal file
26
Task/Queue-Usage/PowerShell/queue-usage-1.psh
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
[System.Collections.ArrayList]$queue = @()
|
||||
# isEmpty?
|
||||
if ($queue.Count -eq 0) {
|
||||
"isEmpty? result : the queue is empty"
|
||||
} else {
|
||||
"isEmpty? result : the queue is not empty"
|
||||
}
|
||||
"the queue contains : $queue"
|
||||
$queue += 1 # push
|
||||
"push result : $queue"
|
||||
$queue += 2 # push
|
||||
$queue += 3 # push
|
||||
"push result : $queue"
|
||||
|
||||
$queue.RemoveAt(0) # pop
|
||||
"pop result : $queue"
|
||||
|
||||
$queue.RemoveAt(0) # pop
|
||||
"pop result : $queue"
|
||||
|
||||
if ($queue.Count -eq 0) {
|
||||
"isEmpty? result : the queue is empty"
|
||||
} else {
|
||||
"isEmpty? result : the queue is not empty"
|
||||
}
|
||||
"the queue contains : $queue"
|
||||
Loading…
Add table
Add a link
Reference in a new issue