{"ScriptPreparationCode":"function createNode(data, next) {\r\n return {\r\n data: data,\r\n next\r\n };\r\n}\r\n\r\nclass LinkedList {\r\n _head = null;\r\n\r\n unshift(data) {\r\n const node = createNode(data);\r\n\r\n if (this._head === null) {\r\n this._head = node;\r\n } else {\r\n node.next = this._head;\r\n this._head = node;\r\n }\r\n }\r\n\r\n shift() {\r\n const node = this._head;\r\n this._head = this._head.next;\r\n return node;\r\n }\r\n}\r\n\r\n","TestCases":[{"Name":"Linked List","Code":"const list = new LinkedList();\r\nlet x = 10000;\r\n\r\nwhile(x--) {\r\n list.unshift(x);\r\n}\r\n","IsDeferred":false},{"Name":"Array","Code":"const array = [];\r\nlet x = 10000;\r\n\r\nwhile(x--) {\r\n array.push(x); \r\n}","IsDeferred":false},{"Name":"Set","Code":"const s = new Set();\r\nlet x = 10000;\r\n\r\nwhile(x--) {\r\n s.add(x); \r\n}","IsDeferred":false}]}