Файловый менеджер - Редактировать - /home/jogoso94/public_html/jogos/tutti_frutti_match/redblackset.js
�азад
"use strict";{const a={},b=!0,c=!1;a.RBnode=function(t){this.tree=t,this.right=this.tree.sentinel,this.left=this.tree.sentinel,this.parent=null,this.color=!1,this.key=null},a.RedBlackSet=function(t){this.size=0,this.sentinel=new a.RBnode(this),this.sentinel.color=c,this.root=this.sentinel,this.root.parent=this.sentinel,this.compare=t||this.default_compare},a.RedBlackSet.prototype.default_compare=function(t,e){return t<e?-1:e<t?1:0},a.RedBlackSet.prototype.clone=function(){var t=new a.RedBlackSet(this.compare);return t.insertAll(this),t},a.RedBlackSet.prototype.clear=function(){this.size=0,this.sentinel=new a.RBnode(this),this.sentinel.color=c,this.root=this.sentinel,this.root.parent=this.sentinel},a.RedBlackSet.prototype.leftRotate=function(t){var e=t.right;t.right=e.left,e.left!=this.sentinel&&(e.left.parent=t),e.parent=t.parent,t.parent==this.sentinel?this.root=e:t==t.parent.left?t.parent.left=e:t.parent.right=e,(e.left=t).parent=e},a.RedBlackSet.prototype.rightRotate=function(t){var e=t.left;t.left=e.right,e.right!=this.sentinel&&(e.right.parent=t),e.parent=t.parent,t.parent==this.sentinel?this.root=e:t==t.parent.right?t.parent.right=e:t.parent.left=e,(e.right=t).parent=e},a.RedBlackSet.prototype.insert=function(t){if(this.contains(t))this.get_(t).key=t;else{for(var e=new a.RBnode(this),r=(e.key=t,this.sentinel),i=this.root;i!=this.sentinel;)r=i,i=this.compare(e.key,i.key)<0?i.left:i.right;(e.parent=r)==this.sentinel?this.root=e:this.compare(e.key,r.key)<0?r.left=e:r.right=e,e.left=this.sentinel,e.right=this.sentinel,e.color=b,this.insertFixup(e),this.size++}},a.RedBlackSet.prototype.insertFixup=function(t){for(;t!=this.sentinel&&t!=this.root&&t.parent.color==b;){var e;t.parent==t.parent.parent.left?(e=t.parent.parent.right).color==b?(t.parent.color=c,e.color=c,t.parent.parent.color=b,t=t.parent.parent):(t==t.parent.right&&(t=t.parent,this.leftRotate(t)),t.parent.color=c,t.parent.parent.color=b,t.parent.parent!=this.sentinel&&this.rightRotate(t.parent.parent)):(e=t.parent.parent.left).color==b?(t.parent.color=c,e.color=c,t.parent.parent.color=b,t=t.parent.parent):(t==t.parent.left&&(t=t.parent,this.rightRotate(t)),t.parent.color=c,t.parent.parent.color=b,t.parent.parent!=this.sentinel&&this.leftRotate(t.parent.parent))}this.root.color=c},a.RedBlackSet.prototype.delete_=function(t){var e=t.left==this.sentinel||t.right==this.sentinel?t:this.successor_(t),r=e.left!=this.sentinel?e.left:e.right;r.parent=e.parent,e.parent==this.sentinel?this.root=r:e==e.parent.left?e.parent.left=r:e.parent.right=r,e!=t&&(t.key=e.key),e.color==c&&this.deleteFixup(r),this.size--},a.RedBlackSet.prototype.deleteFixup=function(t){for(;t!=this.root&&t.color==c;){var e;t=t==t.parent.left?((e=t.parent.right).color==b&&(e.color=c,t.parent.color=b,this.leftRotate(t.parent),e=t.parent.right),e.left.color==c&&e.right.color==c?(e.color=b,t.parent):(e.right.color==c&&(e.left.color=c,e.color=b,this.rightRotate(e),e=t.parent.right),e.color=t.parent.color,t.parent.color=c,e.right.color=c,this.leftRotate(t.parent),this.root)):((e=t.parent.left).color==b&&(e.color=c,t.parent.color=b,this.rightRotate(t.parent),e=t.parent.left),e.right.color==c&&e.left.color==c?(e.color=b,t.parent):(e.left.color==c&&(e.right.color=c,e.color=b,this.leftRotate(e),e=t.parent.left),e.color=t.parent.color,t.parent.color=c,e.left.color=c,this.rightRotate(t.parent),this.root))}t.color=c},a.RedBlackSet.prototype.remove=function(t){var e,t=this.get_(t);return t!=this.sentinel?(e=t.key,this.delete_(t),e):null},a.RedBlackSet.prototype.removeSwapped=function(t,e){this.remove(e)},a.RedBlackSet.prototype.min=function(t){for(;t.left!=this.sentinel;)t=t.left;return t},a.RedBlackSet.prototype.max=function(t){for(;t.right!=this.sentinel;)t=t.right;return t},a.RedBlackSet.prototype.successor_=function(t){if(t.right!=this.sentinel)return this.min(t.right);for(var e=t.parent;e!=this.sentinel&&t==e.right;)e=(t=e).parent;return e},a.RedBlackSet.prototype.predeccessor_=function(t){if(t.left!=this.sentinel)return this.max(t.left);for(var e=t.parent;e!=this.sentinel&&t==e.left;)e=(t=e).parent;return e},a.RedBlackSet.prototype.successor=function(t){if(0<this.size){var e=this.get_(t);if(e==this.sentinel)return null;if(e.right!=this.sentinel)return this.min(e.right).key;for(var r=e.parent;r!=this.sentinel&&e==r.right;)r=(e=r).parent;return r!=this.sentinel?r.key:null}return null},a.RedBlackSet.prototype.predecessor=function(t){if(0<this.size){var e=this.get_(t);if(e==this.sentinel)return null;if(e.left!=this.sentinel)return this.max(e.left).key;for(var r=e.parent;r!=this.sentinel&&e==r.left;)r=(e=r).parent;return r!=this.sentinel?r.key:null}return null},a.RedBlackSet.prototype.getMin=function(){return this.min(this.root).key},a.RedBlackSet.prototype.getMax=function(){return this.max(this.root).key},a.RedBlackSet.prototype.get_=function(t){for(var e=this.root;e!=this.sentinel&&0!=this.compare(e.key,t);)e=this.compare(t,e.key)<0?e.left:e.right;return e},a.RedBlackSet.prototype.contains=function(t){return null!=this.get_(t).key},a.RedBlackSet.prototype.getValues=function(){var e=[];return this.forEach(function(t){e.push(t)}),e},a.RedBlackSet.prototype.insertAll=function(t){if("array"==a.typeOf(t))for(var e=0;e<t.length;e++)this.insert(t[e]);else if("function"==a.typeOf(t.forEach))t.forEach(this.insert,this);else if("function"==a.typeOf(t.getValues))for(var r=t.getValues(),e=0;e<r.length;e++)this.insert(r[e]);else if("object"==a.typeOf(t))for(var i in t)this.insert(t[i])},a.RedBlackSet.prototype.removeAll=function(t){if("array"==a.typeOf(t))for(var e=0;e<t.length;e++)this.remove(t[e]);else if("function"==a.typeOf(t.forEach))t.forEach(this.removeSwapped,this);else if("function"==a.typeOf(t.getValues))for(var r=t.getValues(),e=0;e<r.length;e++)this.remove(r[e]);else if("object"==a.typeOf(t))for(var i in t)this.remove(t[i])},a.RedBlackSet.prototype.containsAll=function(t){if("array"==a.typeOf(t)){for(var e=0;e<t.length;e++)if(!this.contains(t[e]))return!1;return!0}if("function"==a.typeOf(t.forEach))return t.every(this.contains,this);if("function"==a.typeOf(t.getValues)){for(var r=t.getValues(),e=0;e<r.length;e++)if(!this.contains(r[e]))return!1;return!0}if("object"==a.typeOf(t)){for(var i in t)if(!this.contains(t[i]))return!1;return!0}},a.RedBlackSet.prototype.range=function(t,e){var r=[];return this.traverseFromTo(function(t){r.push(t)},t,e),r},a.RedBlackSet.prototype.traverse=function(t,e){if(!this.isEmpty())for(var r=this.min(this.root);r!=this.sentinel;){if(t.call(e,r.key,this))return;r=this.successor_(r)}},a.RedBlackSet.prototype.traverseFrom=function(t,e,r){if(!this.isEmpty())for(var i=this.get_(e);i!=this.sentinel;){if(t.call(r,i.key,this))return;i=this.successor_(i)}},a.RedBlackSet.prototype.traverseTo=function(t,e,r){if(!this.isEmpty())for(var i=this.min(this.root),n=this.get_(e);i!=n;){if(t.call(r,i.key,this))return;i=this.successor_(i)}},a.RedBlackSet.prototype.traverseFromTo=function(t,e,r,i){if(!this.isEmpty())for(var n=this.get_(e),o=this.get_(r);n!=o;){if(t.call(i,n.key,this))return;n=this.successor_(n)}},a.RedBlackSet.prototype.traverseBackwards=function(t,e){if(!this.isEmpty())for(var r=this.max(this.root);r!=this.sentinel;){if(t.call(e,r.key,this))return;r=this.predeccessor_(r)}},a.RedBlackSet.prototype.forEach=function(t,e){if(!this.isEmpty())for(var r=this.min(this.root);r!=this.sentinel;r=this.successor_(r))t.call(e,r.key,r.key,this)},a.RedBlackSet.prototype.some=function(t,e){if(!this.isEmpty())for(var r=this.min(this.root);r!=this.sentinel;r=this.successor_(r))if(t.call(e,r.key,r.key,this))return!0;return!1},a.RedBlackSet.prototype.every=function(t,e){if(this.isEmpty())return!1;for(var r=this.min(this.root);r!=this.sentinel;r=this.successor_(r))if(!t.call(e,r.key,r.key,this))return!1;return!0},a.RedBlackSet.prototype.map=function(t,e){var r=[];if(!this.isEmpty())for(var i=this.min(this.root);i!=this.sentinel;i=this.successor_(i))r.push(t.call(e,i.key,i.key,this));return r},a.RedBlackSet.prototype.filter=function(t,e){var r=[];if(!this.isEmpty())for(var i=this.min(this.root);i!=this.sentinel;i=this.successor_(i))t.call(e,i.key,i.key,this)&&r.push(i.key);return r},a.RedBlackSet.prototype.getCount=function(){return this.size},a.RedBlackSet.prototype.isEmpty=function(){return 0==this.size},a.RedBlackSet.prototype.isSubsetOf=function(t){var e=a.getCount(t);if(this.getCount()>e)return!1;var r=0;if(this.isEmpty())return!0;for(var i=this.min(this.root);i!=this.sentinel;i=this.successor_(i))a.contains.call(t,t,i.key)&&r++;return r==this.getCount()},a.RedBlackSet.prototype.intersection=function(t){var e=new a.RedBlackSet(this.compare);if(!this.isEmpty())for(var r=this.min(this.root);r!=this.sentinel;r=this.successor_(r))t.contains.call(t,r.key,r.key,this)&&e.insert(r.key);return e},self.RedBlackSet=class{constructor(t){this._rbSet=new a.RedBlackSet(t)}Add(t){this._rbSet.insert(t)}Remove(t){this._rbSet.remove(t)}Has(t){return this._rbSet.contains(t)}Clear(){this._rbSet.clear()}toArray(){return this._rbSet.getValues()}GetSize(){return this._rbSet.getCount()}IsEmpty(){return this._rbSet.isEmpty()}ForEach(t){this._rbSet.forEach(t)}Front(){if(this.IsEmpty())throw new Error("empty set");const t=this._rbSet,e=t.min(t.root);return e.key}Shift(){if(this.IsEmpty())throw new Error("empty set");const t=this.Front();return this.Remove(t),t}*values(){if(!this.IsEmpty()){const e=this._rbSet;for(let t=e.min(e.root);t!=e.sentinel;t=e.successor_(t))yield t.key}}[Symbol.iterator](){return this.values()}}}
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генераци� �траницы: 0 |
proxy
|
phpinfo
|
�а�тройка