chore: manual translations (#42811)
This commit is contained in:
committed by
GitHub
parent
a3395269a0
commit
c4fd49e5b7
@ -144,7 +144,7 @@ function Node(value) {
|
||||
function BinarySearchTree() {
|
||||
this.root = null;
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
|
@ -145,7 +145,7 @@ function Node(value) {
|
||||
function BinarySearchTree() {
|
||||
this.root = null;
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
|
@ -89,7 +89,7 @@ function BinarySearchTree() {
|
||||
}
|
||||
function isBinarySearchTree(tree) {
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
|
@ -160,7 +160,7 @@ assert(
|
||||
DoublyLinkedList.prototype = Object.assign(
|
||||
DoublyLinkedList.prototype,
|
||||
{
|
||||
|
||||
|
||||
print() {
|
||||
if (this.head == null) {
|
||||
return null;
|
||||
@ -204,7 +204,7 @@ var DoublyLinkedList = function() {
|
||||
this.head = null;
|
||||
this.tail = null;
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
};
|
||||
```
|
||||
|
@ -210,7 +210,7 @@ var hash = string => {
|
||||
var HashTable = function() {
|
||||
this.collection = {};
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
};
|
||||
```
|
||||
|
@ -158,7 +158,7 @@ assert(
|
||||
var Map = function() {
|
||||
this.collection = {};
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
};
|
||||
```
|
||||
|
@ -170,7 +170,7 @@ class Set {
|
||||
}
|
||||
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
|
@ -139,7 +139,7 @@ var Node = function() {
|
||||
};
|
||||
var Trie = function() {
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
};
|
||||
```
|
||||
|
@ -16,7 +16,7 @@ Once it reaches one end of a path, the search will backtrack to the last node wi
|
||||
|
||||
The animation below shows how the algorithm works. The algorithm starts with the top node and visits the nodes in the numbered order.
|
||||
|
||||
<img class='img-responsive' src='https://camo.githubusercontent.com/aaad9e39961daf34d967c616edeb50abf3bf1235/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f372f37662f44657074682d46697273742d5365617263682e676966'>
|
||||
<img class='img-responsive' src='https://camo.githubusercontent.com/aaad9e39961daf34d967c616edeb50abf3bf1235/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f372f37662f44657074682d46697273742d5365617263682e676966' />
|
||||
|
||||
Notice how, unlike breadth-first search, every time a node is visited, it doesn't visit all of its neighbors. Instead, it first visits one of its neighbors and continues down that path until there are no more nodes to be visited on that path.
|
||||
|
||||
|
@ -261,7 +261,7 @@ function Node(value) {
|
||||
function BinarySearchTree() {
|
||||
this.root = null;
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
@ -278,7 +278,7 @@ function Node(value) {
|
||||
function BinarySearchTree() {
|
||||
this.root = null;
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
this.findMinHeight = function(root = this.root) {
|
||||
// empty tree.
|
||||
|
@ -187,7 +187,7 @@ function Node(value) {
|
||||
function BinarySearchTree() {
|
||||
this.root = null;
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
|
@ -125,14 +125,14 @@ function createRandomArray(size = 5){
|
||||
let a = new Array(size);
|
||||
for(let i = 0; i < size; i++)
|
||||
a[i] = Math.floor(Math.random() * 100);
|
||||
|
||||
|
||||
return a;
|
||||
}
|
||||
const array = createRandomArray(25);
|
||||
|
||||
var MinHeap = function() {
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
};
|
||||
```
|
||||
|
@ -123,7 +123,7 @@ assert(
|
||||
```js
|
||||
var MaxHeap = function() {
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
};
|
||||
```
|
||||
|
@ -160,7 +160,7 @@ function Node(value) {
|
||||
function BinarySearchTree() {
|
||||
this.root = null;
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
|
@ -124,7 +124,7 @@ class Set {
|
||||
return newSet;
|
||||
}
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
|
@ -200,7 +200,7 @@ class Set {
|
||||
return newSet;
|
||||
}
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
|
@ -101,7 +101,7 @@ class Set {
|
||||
return newSet;
|
||||
}
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
|
@ -194,7 +194,7 @@ function LinkedList() {
|
||||
previous = currentNode;
|
||||
currentNode = currentNode.next;
|
||||
}
|
||||
|
||||
|
||||
if (currentNode.next === null && currentNode.element !== element) {
|
||||
return;
|
||||
}
|
||||
|
@ -48,8 +48,11 @@ assert(
|
||||
|
||||
```js
|
||||
function checkSet(){
|
||||
var set = null;
|
||||
return set;
|
||||
// Only change code below this line
|
||||
var set = null;
|
||||
|
||||
// Only change code above this line
|
||||
return set;
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -165,7 +165,7 @@ var DoublyLinkedList = function() {
|
||||
this.head = null;
|
||||
this.tail = null;
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
};
|
||||
```
|
||||
|
@ -214,7 +214,7 @@ function Node(value) {
|
||||
function BinarySearchTree() {
|
||||
this.root = null;
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
|
@ -278,7 +278,7 @@ function Node(value) {
|
||||
function BinarySearchTree() {
|
||||
this.root = null;
|
||||
// Only change code below this line
|
||||
|
||||
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user