{"ScriptPreparationCode":"var max1 = 100;\r\nvar max2 = 1000;\r\nvar max3 = 10000;\r\nvar max = 1000\r\n\r\n\r\nvar time1 = 0;\r\nvar time12 = 0;\r\nvar time13 = 0;\r\n\r\nvar total1 = 0;\r\nvar total12 = 0;\r\nvar total13 = 0;\r\nvar number1 = 0;\r\nvar number12 = 0;\r\nvar number13 = 0;\r\n\r\nvar time2 = 0;\r\nvar time22 = 0;\r\nvar time33 = 0;\r\n\r\nvar total2 = 0;\r\nvar total22 = 0;\r\nvar total23 = 0;\r\nvar number2 = 0;\r\nvar number22 = 0;\r\nvar number23 = 0;\r\n\r\nvar time3 = 0;\r\nvar time32 = 0;\r\nvar time33 = 0;\r\n\r\nvar total3 = 0;\r\nvar total32 = 0;\r\nvar total33 = 0;\r\nvar number3 = 0;\r\nvar number32 = 0;\r\nvar number33 = 0;\r\n\r\nvar arr1 = [];\r\nfor (var i = 0; i \u003C= max1; i\u002B\u002B) { arr1.push({id: Math.floor(Math.random() * max)}); }\r\nvar arr12 = [];\r\nfor (var i = 0; i \u003C= max1; i\u002B\u002B) { arr12.push({id: Math.floor(Math.random() * max)}); }\r\n\r\nvar arr2 = [];\r\nfor (var i = 0; i \u003C= max2; i\u002B\u002B) { arr2.push({id: Math.floor(Math.random() * max)}); }\r\nvar arr22 = [];\r\nfor (var i = 0; i \u003C= max2; i\u002B\u002B) { arr22.push({id: Math.floor(Math.random() * max)}); }\r\n\r\nvar arr3 = [];\r\nfor (var i = 0; i \u003C= max3; i\u002B\u002B) { arr3.push({id: Math.floor(Math.random() * max)}); }\r\nvar arr32 = [];\r\nfor (var i = 0; i \u003C= max3; i\u002B\u002B) { arr32.push({id: Math.floor(Math.random() * max)}); }","TestCases":[{"Name":"O(n2) * 100","Code":"const start1 = new Date();\r\nnumber1\u002B\u002B;\r\narr1.filter(el1 =\u003E arr12.includes(el12 =\u003E el12.id === el1.id));\r\ntime1 = (new Date().getTime() - start1.getTime())\r\nconst timeMS1 = time1 / 1000;\r\ntotal1 = total1 \u002B time1;\r\ndocument.querySelector(\u0022#test1\u0022).innerText = \u0060O(n2) * 100 ${time1} ms / ${timeMS1} sec \r\n/ total ms ${total1} \r\n/ total sec ${total1 / 1000} / \r\n/ Number of executions ${number1}\r\n/ Average execution time per sample ${total1 / number1}\u0060;","IsDeferred":false},{"Name":"O(n2) * 100 - With Extra Map","Code":"const start12 = new Date();\r\nnumber12\u002B\u002B;\r\narr1.filter(el1 =\u003E arr12.map(el12 =\u003E el12.id).includes(id12 =\u003E id12 === el1.id));\r\ntime12 = (new Date().getTime() - start12.getTime())\r\nconst timeMS12 = time12 / 1000;\r\ntotal12 = total12 \u002B time12;\r\ndocument.querySelector(\u0022#test12\u0022).innerText = \u0060O(n2) * 100 - Extra Map ${time12} ms \r\n/ ${timeMS12} sec \r\n/ total ms ${total12} \r\n/ total sec ${total12 / 1000}\r\n/ Number of executions ${number12}\r\n/ Average execution time per sample ${total12 / number12}\u0060;","IsDeferred":false},{"Name":"O(n) * 100","Code":"const start13 = new Date();\r\nconst m = new Map();\r\nnumber13\u002B\u002B\r\narr1.forEach(el1 =\u003E m.set(el1.id, el1));\r\narr12.filter(el12 =\u003E m.has(el12.id));\r\ntime13 = (new Date().getTime() - start13.getTime())\r\nconst timeMS13 = time13 / 1000;\r\ntotal13 = total13 \u002B time13;\r\ndocument.querySelector(\u0022#test13\u0022).innerText = \u0060O(n) * 100 ${time13} ms \r\n/ ${timeMS13} sec \r\n/ total ms ${total13} \r\n/ total sec ${total13 / 1000}\r\n/ Number of executions ${number13}\r\n/ Average execution time per sample ${total13 / number13}\u0060;","IsDeferred":false},{"Name":"O(n2) * 1000","Code":"const start2 = new Date();\r\nnumber2\u002B\u002B;\r\narr2.filter(el2 =\u003E arr22.includes(el22 =\u003E el22.id === el2.id));\r\ntime2 = (new Date().getTime() - start2.getTime())\r\nconst timeMS2 = time2 / 1000;\r\ntotal2 = total2 \u002B time2;\r\ndocument.querySelector(\u0022#test2\u0022).innerText = \u0060O(n2) * 1000 ${time2} ms \r\n/ ${timeMS2} sec \r\n/ total ms ${total2} \r\n/ total sec ${total2 / 1000}\r\n/ Number of executions ${number2}\r\n/ Average execution time per sample ${total2 / number2}\u0060;","IsDeferred":false},{"Name":"O(n2) * 1000 - With Extra Map","Code":"const start22 = new Date();\r\nnumber22\u002B\u002B;\r\narr2.filter(el2 =\u003E arr22.map(el22 =\u003E el22.id).includes(id22 =\u003E id22 === el2.id));\r\ntime22 = (new Date().getTime() - start22.getTime())\r\nconst timeMS22 = time22 / 1000;\r\ntotal22 = total22 \u002B time22;\r\ndocument.querySelector(\u0022#test22\u0022).innerText = \u0060O(n2) * 1000 - Extra Map ${time22} ms \r\n/ ${timeMS22} sec \r\n/ total ms ${total2} \r\n/ total sec ${total22 / 1000}\r\n/ Number of executions ${number22}\r\n/ Average execution time per sample ${total22 / number22}\u0060;","IsDeferred":false},{"Name":"O(n) * 1000","Code":"const start23 = new Date();\r\nnumber23\u002B\u002B;\r\nconst m = new Map();\r\narr2.forEach(el2 =\u003E m.set(el2.id, el2));\r\narr22.filter(el22 =\u003E m.has(el22.id));\r\ntime23 = new Date().getTime() - start23.getTime()\r\nconst timeMS23 = time23 / 1000;\r\ntotal23 = total23 \u002B time23;\r\ndocument.querySelector(\u0022#test23\u0022).innerText = \u0060O(n) * 1000 ${time23} ms \r\n/ ${timeMS23} sec \r\n/ total ms ${total23} \r\n/ total sec ${total23 / 1000}\r\n/ Number of executions ${number23}\r\n/ Average execution time per sample ${total23 / number23}\u0060;","IsDeferred":false},{"Name":"O(n2) * 10000","Code":"const start3 = new Date();\r\nnumber3\u002B\u002B;\r\narr3.filter(el3 =\u003E arr32.includes(el32 =\u003E el32.id === el3.id));\r\ntime3 = (new Date().getTime() - start3.getTime())\r\nconst timeMS3 = time3 / 1000;\r\ntotal3 = total3 \u002B time3;\r\ndocument.querySelector(\u0022#test3\u0022).innerText = \u0060O(n2) * 10000 ${time3} ms \r\n/ ${timeMS3} sec \r\n/ total ms ${total3} \r\n/ total sec ${total3 / 1000}\r\n/ Number of executions ${number3}\r\n/ Average execution time per sample ${total3 / number3}\u0060;","IsDeferred":false},{"Name":"O(n2) * 10000 - With Extra Map","Code":"const start32 = new Date();\r\nnumber32\u002B\u002B;\r\narr3.filter(el3 =\u003E arr32.map(el32 =\u003E el32.id).includes(id32 =\u003E id32 === el3.id));\r\ntime32 = (new Date().getTime() - start32.getTime())\r\nconst timeMS32 = time32 / 1000;\r\ntotal32 = total32 \u002B time32;\r\ndocument.querySelector(\u0022#test32\u0022).innerText = \u0060O(n2) * 10000 - Extra Map ${time32} ms \r\n/ ${timeMS32} sec \r\n/ total ms ${total32} \r\n/ total sec ${total32 / 1000}\r\n/ Number of executions ${number32}\r\n/ Average execution time per sample ${total32 / number32}\u0060;","IsDeferred":false},{"Name":"O(n) * 10000","Code":"const start33 = new Date();\r\nnumber33\u002B\u002B;\r\nconst m = new Map();\r\narr3.forEach(el3 =\u003E m.set(el3.id, el3));\r\narr32.filter(el32 =\u003E m.has(el32.id));\r\ntime33 = (new Date().getTime() - start33.getTime())\r\nconst timeMS33 = time33 / 1000;\r\ntotal33 = total33 \u002B time33;\r\ndocument.querySelector(\u0022#test33\u0022).innerText = \u0060O(n) * 10000 ${time33} ms \r\n/ ${timeMS33} sec \r\n/ total ms ${total33} \r\n/ total sec ${total33 / 1000}\r\n/ Number of executions ${number33}\r\n/ Average execution time per sample ${total33 / number33}\u0060;","IsDeferred":false}]}