mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-26 07:01:18 +08:00
README fixes.
This commit is contained in:
parent
80d2f508d3
commit
7d13e6863a
@ -1,5 +1,8 @@
|
||||
# Caesar Cipher Algorithm
|
||||
|
||||
_Read this in other languages:_
|
||||
[_Русский_](README.ru-RU.md)
|
||||
|
||||
In cryptography, a **Caesar cipher**, also known as **Caesar's cipher**, the **shift cipher**, **Caesar's code** or **Caesar shift**, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of `3`, `D` would be replaced by `A`, `E` would become `B`, and so on. The method is named after Julius Caesar, who used it in his private correspondence.
|
||||
|
||||
![Caesar Cipher Algorithm](https://upload.wikimedia.org/wikipedia/commons/4/4a/Caesar_cipher_left_shift_of_3.svg)
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Linked List Traversal
|
||||
|
||||
_Read this in other languages:_
|
||||
[_Русский_](README.ru-RU.md)
|
||||
[_Русский_](README.ru-RU.md),
|
||||
[中文](README.zh-CN.md)
|
||||
|
||||
The task is to traverse the given linked list in straight order.
|
||||
|
@ -43,7 +43,7 @@ export default function knuthMorrisPratt(text, word) {
|
||||
if (text[textIndex] === word[wordIndex]) {
|
||||
// We've found a match.
|
||||
if (wordIndex === word.length - 1) {
|
||||
return textIndex - word.length + 1;
|
||||
return (textIndex - word.length) + 1;
|
||||
}
|
||||
wordIndex += 1;
|
||||
textIndex += 1;
|
||||
|
Loading…
Reference in New Issue
Block a user