all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
13
Task/Stack/MATLAB/stack-1.m
Normal file
13
Task/Stack/MATLAB/stack-1.m
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
mystack = {};
|
||||
|
||||
% push
|
||||
mystack{end+1} = x;
|
||||
|
||||
%pop
|
||||
x = mystack{end}; mystack{end} = [];
|
||||
|
||||
%peek,top
|
||||
x = mystack{end};
|
||||
|
||||
% empty
|
||||
isempty(mystack)
|
||||
Loading…
Add table
Add a link
Reference in a new issue