Queue/Definition: Difference between revisions
Content added Content deleted
(CoffeeScript) |
|||
Line 1,449: | Line 1,449: | ||
return queue.first > queue.last |
return queue.first > queue.last |
||
end</lang> |
end</lang> |
||
=={{header|Mathematica}}== |
|||
<lang Mathematica>Empty[a_] := If[Length[a] == 0, True, False] |
|||
SetAttributes[Push, HoldAll]; Push[a_, elem_] := AppendTo[a, elem] |
|||
SetAttributes[Pop, HoldAllComplete]; Pop[a_] := If[EmptyQ[a], False, b = First[a]; Set[a, Most[a]]; b]</lang> |
|||
=={{header|MATLAB}}== |
=={{header|MATLAB}}== |