-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs__algorithm__datasources__aggregate.md.js
More file actions
1 lines (1 loc) · 6.55 KB
/
docs__algorithm__datasources__aggregate.md.js
File metadata and controls
1 lines (1 loc) · 6.55 KB
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[2],{l1DL:function(e,n,t){"use strict";t.r(n);var a=t("q1tI"),l=t.n(a),i=t("dEAq"),r=t("H1Ra"),s=l.a.memo((e=>{e.demos;return l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{className:"markdown"},l.a.createElement("h2",{id:"\u96c6\u5408\u7684\u6982\u5ff5\u548c\u7528\u9014"},l.a.createElement(i["AnchorLink"],{to:"#\u96c6\u5408\u7684\u6982\u5ff5\u548c\u7528\u9014","aria-hidden":"true",tabIndex:-1},l.a.createElement("span",{className:"icon icon-link"})),"\u96c6\u5408\u7684\u6982\u5ff5\u548c\u7528\u9014"),l.a.createElement("ul",null,l.a.createElement("li",null,l.a.createElement("p",null,"\u96c6\u5408\u662f\u4e00\u79cd\u5305\u542b\u4e0d\u540c\u5143\u7d20\u6570\u636e\u7ed3\u6784")),l.a.createElement("li",null,l.a.createElement("p",null,"\u5f53\u60f3\u8981\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u7ed3\u6784\uff0c\u7528\u6765\u4fdd\u5b58\u4e00\u7aef\u72ec\u4e00\u65e0\u4e8c\u7684\u6587\u5b57\u7684\u65f6\u5019\u96c6\u5408\u5c31\u975e\u5e38\u6709\u7528")),l.a.createElement("li",null,l.a.createElement("p",null,"\u96c6\u5408\u7684\u6210\u5458\u662f\u65e0\u5e8f\u7684")),l.a.createElement("li",null,l.a.createElement("p",null,"\u96c6\u5408\u4e0d\u5141\u8bb8\u76f8\u540c\u6210\u5458\u5b58\u5728"))),l.a.createElement("h2",{id:"\u96c6\u5408\u5173\u952e\u6982\u5ff5"},l.a.createElement(i["AnchorLink"],{to:"#\u96c6\u5408\u5173\u952e\u6982\u5ff5","aria-hidden":"true",tabIndex:-1},l.a.createElement("span",{className:"icon icon-link"})),"\u96c6\u5408\u5173\u952e\u6982\u5ff5"),l.a.createElement("ul",null,l.a.createElement("li",null,l.a.createElement("p",null,"\u96c6\u5408\u662f\u4e00\u7ec4\u65e0\u5e8f\u4f46\u5f7c\u6b64\u4e4b\u95f4\u53c8\u6709\u4e00\u5b9a\u76f8\u5173\u6027\u7684\u6210\u5458\u6784\u6210\u7684\uff0c\u96c6\u5408\u4e2d\u7684\u5143\u7d20\u79f0\u4e3a\u6210\u5458")),l.a.createElement("li",null,l.a.createElement("p",null,"\u4e0d\u5305\u542b\u4efb\u4f55\u6210\u5458\u7684\u96c6\u5408\u79f0\u4e3a",l.a.createElement("strong",null,"\u7a7a\u96c6"),"\uff0c",l.a.createElement("strong",null,"\u5168\u96c6"),"\u5219\u5305\u542b\u4e00\u5207\u53ef\u80fd\u6210\u5458\u7684\u96c6\u5408")),l.a.createElement("li",null,l.a.createElement("p",null,"\u5982\u679c\u4e24\u4e2a\u96c6\u5408\u7684\u6210\u5458\u5b8c\u5168\u76f8\u540c\uff0c\u5219\u79f0\u4e3a\u4e24\u4e2a\u96c6\u5408",l.a.createElement("strong",null,"\u76f8\u7b49"))),l.a.createElement("li",null,l.a.createElement("p",null,"\u5982\u679c\u4e00\u4e2a\u96c6\u5408\u4e2d\u7684\u6240\u6709\u6210\u5458\u90fd\u5c5e\u4e8e\u53e6\u5916\u4e00\u4e2a\u96c6\u5408\uff0c\u5219\u524d\u4e00\u4e2a\u96c6\u5408\u79f0\u4e3a\u540e\u4e00\u4e2a\u96c6\u5408\u7684\u5b50\u96c6")),l.a.createElement("li",null,l.a.createElement("p",null,l.a.createElement("strong",null,"\u5e76\u96c6"),"\uff1a\u5c06\u4e24\u4e2a\u96c6\u5408\u7684\u6210\u5458\u8fdb\u884c\u5408\u5e76\uff0c\u5f97\u5230\u4e00\u4e2a\u65b0\u7684\u96c6\u5408")),l.a.createElement("li",null,l.a.createElement("p",null,l.a.createElement("strong",null,"\u4ea4\u96c6"),"\uff1a\u4e24\u4e2a\u96c6\u5408\u5171\u540c\u5b58\u5728\u7684\u6210\u5458\u7ec4\u6210\u4e00\u4e2a\u65b0\u7684\u96c6\u5408")),l.a.createElement("li",null,l.a.createElement("p",null,l.a.createElement("strong",null,"\u8865\u96c6"),"\uff1a\u5c5e\u4e8e\u4e00\u4e2a\u96c6\u5408\u4e0d\u5c5e\u4e8e\u53e6\u5916\u4e00\u4e2a\u96c6\u5408\u7684\u6210\u5458\u7ec4\u6210\u7684\u96c6\u5408"))),l.a.createElement("h2",{id:"\u4ee3\u7801\u5b9e\u73b0"},l.a.createElement(i["AnchorLink"],{to:"#\u4ee3\u7801\u5b9e\u73b0","aria-hidden":"true",tabIndex:-1},l.a.createElement("span",{className:"icon icon-link"})),"\u4ee3\u7801\u5b9e\u73b0"),l.a.createElement(r["a"],{code:"function Set() {\n this.dataStore = [];\n this.add = add;\n this.remove = remove;\n this.show = show;\n this.union = union;\n this.intersect = intersect;\n this.difference = difference;\n this.contains = contains;\n this.size = size;\n this.subset = subset;\n}\n//\u65b0\u589e\nfunction add(data) {\n if (this.dataStore.indexOf(data) === -1) {\n this.dataStore.push(data);\n } else {\n return false;\n }\n}\n\n//\u5220\u9664\nfunction remove(data) {\n var index = this.dataStore.indexOf(data);\n if (index > -1) {\n this.dataStore.splice(index, 1);\n } else {\n return false;\n }\n}\n\n//\u663e\u793a\nfunction show() {\n return this.dataStore;\n}\n\n//\u5e76\u96c6\nfunction union(set) {\n var tempSet = new Set();\n for (let i = 0; i < this.dataStore.length; i++) {\n tempSet.add(this.dataStore[i]);\n }\n for (let i = 0; i < set.dataStore.length; i++) {\n if (tempSet.contains(set.dataStore[i])) {\n tempSet.add(set.dataStore[i]);\n }\n }\n return tempSet;\n}\nfunction contains(data) {\n if (this.dataStore.indexOf(data) > -1) {\n return true;\n } else {\n return false;\n }\n}\n//\u4ea4\u96c6\nfunction intersect(set) {\n var tempSet = new Set();\n for (let i = 0; i < this.dataStore.length; i++) {\n if (set.contains(this.dataStore[i])) {\n tempSet.add(this.dataStore[i]);\n }\n }\n return tempSet;\n}\n//\u8865\u96c6\nfunction difference(set) {\n var tempSet = new Set();\n for (let i = 0; i < this.dataStore.length; i++) {\n if (!set.contains(this.dataStore[i])) {\n tempSet.add(this.dataStore[i]);\n }\n }\n return tempSet;\n}\n\n//\u5224\u65ad\u662f\u4e0d\u662f\u5b50\u96c6\nfunction size() {\n return this.dataStore.length;\n}\n\nfunction subset(set) {\n if (set.size() > this.size()) {\n return false;\n } else {\n for (let i = 0; i < set.dataStore.length; i++) {\n if (!this.contains(set.dataStore[i])) {\n return false;\n }\n }\n return true;\n }\n}\n\nvar names = new Set();\nnames.add('\u5c0f\u7ea2');\nnames.add('\u5c0f\u91cc');\nnames.add('\u5c0f\u84dd');\nnames.add('\u5c0f\u5f20');\nnames.add('\u5c0f\u674e');\n\nvar cis = new Set();\ncis.add('\u5c0f\u5f20');\ncis.add('\u5c0f\u674e');\n// console.log(cis)\n\n// var newArr=new Set();\nconsole.log('\u5e76\u96c6\uff1a', names.union(cis).show()); //\"\u5c0f\u7ea2\", \"\u5c0f\u91cc\", \"\u5c0f\u84dd\", \"\u5c0f\u5f20\", \"\u5c0f\u674e\"]\nconsole.log('\u4ea4\u96c6\uff1a', names.intersect(cis).show()); //\"\u5c0f\u5f20\", \"\u5c0f\u674e\"\nconsole.log('bu\u96c6\uff1a', names.difference(cis).show()); //\"\u5c0f\u7ea2\", \"\u5c0f\u91cc\", \"\u5c0f\u84dd\"\nconsole.log('cis\u662f\u4e0d\u662fnames\u7684\u5b50\u96c6', names.subset(cis)); //true",lang:"js"})))}));n["default"]=e=>{var n=l.a.useContext(i["context"]),t=n.demos;return l.a.useEffect((()=>{var n;null!==e&&void 0!==e&&null!==(n=e.location)&&void 0!==n&&n.hash&&i["AnchorLink"].scrollToAnchor(decodeURIComponent(e.location.hash.slice(1)))}),[]),l.a.createElement(s,{demos:t})}}}]);