-- Compiled with roblox-ts v1.3.3
local TS = _G[script]
local SinglyLinkedList = TS.import(script, TS.getModule(script, "@rbxts", "linked-lists").out).SinglyLinkedList
--[[
	*
	* An implementation of a stack data structure that is built upon a singly linked list.
]]
local Stack
do
	Stack = setmetatable({}, {
		__tostring = function()
			return "Stack"
		end,
	})
	Stack.__index = Stack
	function Stack.new(...)
		local self = setmetatable({}, Stack)
		return self:constructor(...) or self
	end
	function Stack:constructor()
		self.linkedList = SinglyLinkedList.new()
	end
	function Stack:clear()
		self.linkedList:clear()
	end
	function Stack:isEmpty()
		return self.linkedList:isEmpty()
	end
	function Stack:peek()
		return self.linkedList:peekValueAtHead()
	end
	function Stack:pop()
		return self.linkedList:popHeadValue()
	end
	function Stack:push(value)
		self.linkedList:pushToHead(value)
	end
	function Stack:pushArray(valuesArray)
		for _, value in ipairs(valuesArray) do
			self.linkedList:pushToHead(value)
		end
	end
	function Stack:size()
		return self.linkedList:size()
	end
end
return {
	Stack = Stack,
}
