├── .github ├── code-of-conduct.md ├── contributing.md ├── issue-template.md └── pull-request-template.md ├── algorithms ├── cryptography │ └── morse_code_generator.bf ├── math │ └── fibonacci.bf └── sorting │ └── mergesort.bf ├── license ├── readme.md └── src └── .gitkeep /.github/code-of-conduct.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Attribution 36 | 37 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 38 | 39 | [homepage]: http://contributor-covenant.org 40 | [version]: http://contributor-covenant.org/version/1/4/ 41 | -------------------------------------------------------------------------------- /.github/contributing.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | > Please note that this project is released with a [Contributor Code of Conduct](code-of-conduct.md). By participating in this project you agree to abide by its terms. -------------------------------------------------------------------------------- /.github/issue-template.md: -------------------------------------------------------------------------------- 1 | I am creating an issue because... 2 | -------------------------------------------------------------------------------- /.github/pull-request-template.md: -------------------------------------------------------------------------------- 1 | I am creating a pull request for... 2 | 3 | - [ ] New algorithm 4 | - [ ] Update to an algorithm 5 | - [ ] Fix an error 6 | - [ ] Other - *Describe below* -------------------------------------------------------------------------------- /algorithms/cryptography/morse_code_generator.bf: -------------------------------------------------------------------------------- 1 | Morse Code Generator 2 | store slash 3 | ++++++[>+++++++<-]>+++++> 4 | store space 5 | ++++[>++++++++<-]>> 6 | store dash & dot 7 | +++++[>+++++++++>+++++++++<<-]>+>> 8 | , Prime loop 9 | Main loop 10 | [ 11 | -------------------------------- 12 | space [->+>+<<]>>[-<<+>>]<< 13 | > 14 | [->[-]+<]+>[-<->]< 15 | [ <<<<< <<.>> .>>>>> [-]] 16 | < 17 | ---------------- Shift so that 48 (char '0') is now 0 18 | 0 [->+>+<<]>>[-<<+>>]<< 19 | > 20 | [->[-]+<]+>[-<->]< 21 | [ <<.....>> <<<<<.>>>>> [-]] 22 | <- 23 | 1 [->+>+<<]>>[-<<+>>]<< 24 | > 25 | [->[-]+<]+>[-<->]< 26 | [ <<<.>....>> <<<<<.>>>>> [-]] 27 | <- 28 | 2 [->+>+<<]>>[-<<+>>]<< 29 | > 30 | [->[-]+<]+>[-<->]< 31 | [ <<<..>...>> <<<<<.>>>>> [-]] 32 | <- 33 | 3 [->+>+<<]>>[-<<+>>]<< 34 | > 35 | [->[-]+<]+>[-<->]< 36 | [ <<<...>..>> <<<<<.>>>>> [-]] 37 | <- 38 | 4 [->+>+<<]>>[-<<+>>]<< 39 | > 40 | [->[-]+<]+>[-<->]< 41 | [ <<<....>.>> <<<<<.>>>>> [-]] 42 | <- 43 | 5 [->+>+<<]>>[-<<+>>]<< 44 | > 45 | [->[-]+<]+>[-<->]< 46 | [ <<<.....>>> <<<<<.>>>>> [-]] 47 | <- 48 | 6 [->+>+<<]>>[-<<+>>]<< 49 | > 50 | [->[-]+<]+>[-<->]< 51 | [ <<.<....>>> <<<<<.>>>>> [-]] 52 | <- 53 | 7 [->+>+<<]>>[-<<+>>]<< 54 | > 55 | [->[-]+<]+>[-<->]< 56 | [ <<..<...>>> <<<<<.>>>>> [-]] 57 | <- 58 | 8 [->+>+<<]>>[-<<+>>]<< 59 | > 60 | [->[-]+<]+>[-<->]< 61 | [ <<...<..>>> <<<<<.>>>>> [-]] 62 | <- 63 | 9 [->+>+<<]>>[-<<+>>]<< 64 | > 65 | [->[-]+<]+>[-<->]< 66 | [ <<....<.>>> <<<<<.>>>>> [-]] 67 | < 68 | -------- Uppercase letters 69 | a [->+>+<<]>>[-<<+>>]<< 70 | > 71 | [->[-]+<]+>[-<->]< 72 | [ <<<.>.>> <<<<<.>>>>> [-]] 73 | <- 74 | b [->+>+<<]>>[-<<+>>]<< 75 | > 76 | [->[-]+<]+>[-<->]< 77 | [ <<.<...>>> <<<<<.>>>>> [-]] 78 | <- 79 | c [->+>+<<]>>[-<<+>>]<< 80 | > 81 | [->[-]+<]+>[-<->]< 82 | [ <<.<.>.<.>>> <<<<<.>>>>> [-]] 83 | <- 84 | d [->+>+<<]>>[-<<+>>]<< 85 | > 86 | [->[-]+<]+>[-<->]< 87 | [ <<.<..>>> <<<<<.>>>>> [-]] 88 | <- 89 | e [->+>+<<]>>[-<<+>>]<< 90 | > 91 | [->[-]+<]+>[-<->]< 92 | [ <<<.>>> <<<<<.>>>>> [-]] 93 | <- 94 | f [->+>+<<]>>[-<<+>>]<< 95 | > 96 | [->[-]+<]+>[-<->]< 97 | [ <<<..>.<.>>> <<<<<.>>>>> [-]] 98 | <- 99 | g [->+>+<<]>>[-<<+>>]<< 100 | > 101 | [->[-]+<]+>[-<->]< 102 | [ <<..<.>>> <<<<<.>>>>> [-]] 103 | <- 104 | h [->+>+<<]>>[-<<+>>]<< 105 | > 106 | [->[-]+<]+>[-<->]< 107 | [ <<<....>>> <<<<<.>>>>> [-]] 108 | <- 109 | i [->+>+<<]>>[-<<+>>]<< 110 | > 111 | [->[-]+<]+>[-<->]< 112 | [ <<<..>>> <<<<<.>>>>> [-]] 113 | <- 114 | j [->+>+<<]>>[-<<+>>]<< 115 | > 116 | [->[-]+<]+>[-<->]< 117 | [ <<<.>...>> <<<<<.>>>>> [-]] 118 | <- 119 | k [->+>+<<]>>[-<<+>>]<< 120 | > 121 | [->[-]+<]+>[-<->]< 122 | [ <<.<.>.>> <<<<<.>>>>> [-]] 123 | <- 124 | l [->+>+<<]>>[-<<+>>]<< 125 | > 126 | [->[-]+<]+>[-<->]< 127 | [ <<<.>.<..>>> <<<<<.>>>>> [-]] 128 | <- 129 | m [->+>+<<]>>[-<<+>>]<< 130 | > 131 | [->[-]+<]+>[-<->]< 132 | [ <<..>> <<<<<.>>>>> [-]] 133 | <- 134 | n [->+>+<<]>>[-<<+>>]<< 135 | > 136 | [->[-]+<]+>[-<->]< 137 | [ <<.<.>>> <<<<<.>>>>> [-]] 138 | <- 139 | o [->+>+<<]>>[-<<+>>]<< 140 | > 141 | [->[-]+<]+>[-<->]< 142 | [ <<...>> <<<<<.>>>>> [-]] 143 | <- 144 | p [->+>+<<]>>[-<<+>>]<< 145 | > 146 | [->[-]+<]+>[-<->]< 147 | [ <<<.>..<.>>> <<<<<.>>>>> [-]] 148 | <- 149 | q [->+>+<<]>>[-<<+>>]<< 150 | > 151 | [->[-]+<]+>[-<->]< 152 | [ <<..<.>.>> <<<<<.>>>>> [-]] 153 | <- 154 | r [->+>+<<]>>[-<<+>>]<< 155 | > 156 | [->[-]+<]+>[-<->]< 157 | [ <<<.>.<.>>> <<<<<.>>>>> [-]] 158 | <- 159 | s [->+>+<<]>>[-<<+>>]<< 160 | > 161 | [->[-]+<]+>[-<->]< 162 | [ <<<...>>> <<<<<.>>>>> [-]] 163 | <- 164 | t [->+>+<<]>>[-<<+>>]<< 165 | > 166 | [->[-]+<]+>[-<->]< 167 | [ <<.>> <<<<<.>>>>> [-]] 168 | <- 169 | u [->+>+<<]>>[-<<+>>]<< 170 | > 171 | [->[-]+<]+>[-<->]< 172 | [ <<<..>.>> <<<<<.>>>>> [-]] 173 | <- 174 | v [->+>+<<]>>[-<<+>>]<< 175 | > 176 | [->[-]+<]+>[-<->]< 177 | [ <<<...>.>> <<<<<.>>>>> [-]] 178 | <- 179 | w [->+>+<<]>>[-<<+>>]<< 180 | > 181 | [->[-]+<]+>[-<->]< 182 | [ <<<.>..>> <<<<<.>>>>> [-]] 183 | <- 184 | x [->+>+<<]>>[-<<+>>]<< 185 | > 186 | [->[-]+<]+>[-<->]< 187 | [ <<.<..>.>> <<<<<.>>>>> [-]] 188 | <- 189 | y [->+>+<<]>>[-<<+>>]<< 190 | > 191 | [->[-]+<]+>[-<->]< 192 | [ <<.<.>..>> <<<<<.>>>>> [-]] 193 | <- 194 | z [->+>+<<]>>[-<<+>>]<< 195 | > 196 | [->[-]+<]+>[-<->]< 197 | [ <<..<..>>> <<<<<.>>>>> [-]] 198 | < 199 | ------- 200 | a [->+>+<<]>>[-<<+>>]<< 201 | > 202 | [->[-]+<]+>[-<->]< 203 | [ <<<.>.>> <<<<<.>>>>> [-]] 204 | <- 205 | b [->+>+<<]>>[-<<+>>]<< 206 | > 207 | [->[-]+<]+>[-<->]< 208 | [ <<.<...>>> <<<<<.>>>>> [-]] 209 | <- 210 | c [->+>+<<]>>[-<<+>>]<< 211 | > 212 | [->[-]+<]+>[-<->]< 213 | [ <<.<.>.<.>>> <<<<<.>>>>> [-]] 214 | <- 215 | d [->+>+<<]>>[-<<+>>]<< 216 | > 217 | [->[-]+<]+>[-<->]< 218 | [ <<.<..>>> <<<<<.>>>>> [-]] 219 | <- 220 | # 221 | e [->+>+<<]>>[-<<+>>]<< 222 | > 223 | [->[-]+<]+>[-<->]< 224 | [ <<<.>>> <<<<<.>>>>> [-]] 225 | <- 226 | f [->+>+<<]>>[-<<+>>]<< 227 | > 228 | [->[-]+<]+>[-<->]< 229 | [ <<<..>.<.>>> <<<<<.>>>>> [-]] 230 | <- 231 | g [->+>+<<]>>[-<<+>>]<< 232 | > 233 | [->[-]+<]+>[-<->]< 234 | [ <<..<.>>> <<<<<.>>>>> [-]] 235 | <- 236 | h [->+>+<<]>>[-<<+>>]<< 237 | > 238 | [->[-]+<]+>[-<->]< 239 | [ <<<....>>> <<<<<.>>>>> [-]] 240 | <- 241 | i [->+>+<<]>>[-<<+>>]<< 242 | > 243 | [->[-]+<]+>[-<->]< 244 | [ <<<..>>> <<<<<.>>>>> [-]] 245 | <- 246 | j [->+>+<<]>>[-<<+>>]<< 247 | > 248 | [->[-]+<]+>[-<->]< 249 | [ <<<.>...>> <<<<<.>>>>> [-]] 250 | <- 251 | k [->+>+<<]>>[-<<+>>]<< 252 | > 253 | [->[-]+<]+>[-<->]< 254 | [ <<.<.>.>> <<<<<.>>>>> [-]] 255 | <- 256 | l [->+>+<<]>>[-<<+>>]<< 257 | > 258 | [->[-]+<]+>[-<->]< 259 | [ <<<.>.<..>>> <<<<<.>>>>> [-]] 260 | <- 261 | m [->+>+<<]>>[-<<+>>]<< 262 | > 263 | [->[-]+<]+>[-<->]< 264 | [ <<..>> <<<<<.>>>>> [-]] 265 | <- 266 | n [->+>+<<]>>[-<<+>>]<< 267 | > 268 | [->[-]+<]+>[-<->]< 269 | [ <<.<.>>> <<<<<.>>>>> [-]] 270 | <- 271 | o [->+>+<<]>>[-<<+>>]<< 272 | > 273 | [->[-]+<]+>[-<->]< 274 | [ <<...>> <<<<<.>>>>> [-]] 275 | <- 276 | p [->+>+<<]>>[-<<+>>]<< 277 | > 278 | [->[-]+<]+>[-<->]< 279 | [ <<<.>..<.>>> <<<<<.>>>>> [-]] 280 | <- 281 | q [->+>+<<]>>[-<<+>>]<< 282 | > 283 | [->[-]+<]+>[-<->]< 284 | [ <<..<.>.>> <<<<<.>>>>> [-]] 285 | <- 286 | r [->+>+<<]>>[-<<+>>]<< 287 | > 288 | [->[-]+<]+>[-<->]< 289 | [ <<<.>.<.>>> <<<<<.>>>>> [-]] 290 | <- 291 | s [->+>+<<]>>[-<<+>>]<< 292 | > 293 | [->[-]+<]+>[-<->]< 294 | [ <<<...>>> <<<<<.>>>>> [-]] 295 | <- 296 | t [->+>+<<]>>[-<<+>>]<< 297 | > 298 | [->[-]+<]+>[-<->]< 299 | [ <<.>> <<<<<.>>>>> [-]] 300 | <- 301 | u [->+>+<<]>>[-<<+>>]<< 302 | > 303 | [->[-]+<]+>[-<->]< 304 | [ <<<..>.>> <<<<<.>>>>> [-]] 305 | <- 306 | v [->+>+<<]>>[-<<+>>]<< 307 | > 308 | [->[-]+<]+>[-<->]< 309 | [ <<<...>.>> <<<<<.>>>>> [-]] 310 | <- 311 | w [->+>+<<]>>[-<<+>>]<< 312 | > 313 | [->[-]+<]+>[-<->]< 314 | [ <<<.>..>> <<<<<.>>>>> [-]] 315 | <- 316 | x [->+>+<<]>>[-<<+>>]<< 317 | > 318 | [->[-]+<]+>[-<->]< 319 | [ <<.<..>.>> <<<<<.>>>>> [-]] 320 | <- 321 | y [->+>+<<]>>[-<<+>>]<< 322 | > 323 | [->[-]+<]+>[-<->]< 324 | [ <<.<.>..>> <<<<<.>>>>> [-]] 325 | <- 326 | z [->+>+<<]>>[-<<+>>]<< 327 | > 328 | [->[-]+<]+>[-<->]< 329 | [ <<..<..>>> <<<<<.>>>>> [-]] 330 | <- 331 | [-]>[-]>[-]<<, Take input 332 | ] 333 | -------------------------------------------------------------------------------- /algorithms/math/fibonacci.bf: -------------------------------------------------------------------------------- 1 | [ 2 | Fibonacci Program in Brainfuck 3 | Written by Sam Coppini 4 | Outputs arbitrarily many Fibonacci numbers. Never terminates. 5 | The program stores the result of the last two calculated Fibonacci numbers, 6 | always outputting the smaller one before it moves the larger fib number over 7 | it and replaces the larger number with the sum of the two numbers. 8 | The digits for the last two Fibonacci numbers are represented like so: 9 | b a 1 b a 1 b a 1 0 0 0 10 | ^ ^ ^ 11 | | | | 12 | | | +--- A boolean flag indicating whether the current Fibonacci numbers 13 | | | extend this far into the tape 14 | | | 15 | | +--- Digits for the second to last Fibonacci number 16 | | 17 | +--- Digits for the latest Fibonacci number 18 | ] 19 | Sets up the tape and enters the main loop 20 | ++++++++++>>+>>+[ 21 | Goes through the tape and outputs each digit of the second to last calculated 22 | Fibonacci number 23 | [+++++[<++++++++>-]<.>++++++[<-------->-]+<<<] 24 | Outputs a newline and moves to the last digits of the numbers and enters the 25 | loop to add our current Fibonacci numbers 26 | <.>>>>[ 27 | Moves the value of the smaller fib number to the flag cell 28 | -<[>+<-] 29 | Copies the larger fib number to the newly emptied cell while adding it to the 30 | value stored in the flag cell 31 | <[>+>+<<-]>> 32 | Moves the value in the flag cell to where the larger fib number and while it's 33 | moving the value it also checks to see if it's greater than nine 34 | [<<+>>-[<<+>>-[<<+>>-[<<+>>-[<<+>>-[<<+>>-[<<+>>-[<<+>>-[<<+>>-[ 35 | If the value is greater than nine we move the remainder of the value in the flag 36 | cell to the larger fib cell and carry the one and also make sure that the flag 37 | bit of the next digit is set and then move back to where we were 38 | -<<[-]>>[<<+>>-]>>>[-]+<+<< 39 | Set the flag bit back to one and move to the next digit over 40 | ]]]]]]]]]]+>>>] 41 | Move to the first digit in preparation of printing the number but also make sure 42 | to move over a digit if the first digit would be a zero 43 | <<<<[>>>]<<] 44 | -------------------------------------------------------------------------------- /algorithms/sorting/mergesort.bf: -------------------------------------------------------------------------------- 1 | +>>>>> 2 | >>>>> 3 | >>>>> 4 | >>>>> 5 | temporary values stay up here 6 | +++++>>>>+++++ +++++ > valores 7 | +++++>>>>+++++ ++++ > a 8 | +++++>>>>+++++ +++ > ordenar 9 | +++++>>>>+++++ > sao 10 | +++++>>>>+++++ + > so 11 | +++++>>>>+++++ ++ > dez 12 | +++++>>>>++++ > valores 13 | +++++>>>>+++ > que 14 | +++++>>>>++ > acabam 15 | +++++>>>>+ > aqui 16 | >>> aqui temos um valor indicativo do fim da recursividade 17 | > 18 | > 19 | +++ >>> valor indicativo da necessidade de fazer dois splits 20 | > 0 21 | +++++ +++++ > 10 22 | <<<<< voltar ao header tem 5 bytes cada bloco 23 | [ while nao for 0 24 | --[++ if nao for 2 (ou seja é 3) 25 | copiar o primeiro valor 26 | >>>[-<<+< while houver valor pra copiar 27 | + marcar o bloco a 4 pra voltarmos 28 | [>>>>>] ir para o ultimo bloco 29 | >>>+<<< meter la o valor 30 | ----[++++<<<<<----]++++ voltar ao bloco marcado 31 | - desmarcar o bloco 32 | >>>]<<< fim de while 33 | repetir o processo pro segundo valor 34 | >>>>[-<<+<< 35 | + 36 | [>>>>>] ir para o ultimo bloco 37 | >>>>+<<<< meter la o valor 38 | ----[++++<<<<<----]++++ voltar ao bloco marcado 39 | - 40 | >>>>]<<<< 41 | restaurar os valores copiados 42 | >[->>+<<]< 43 | >>[->>+<<]<< 44 | + marcar o bloco como 4 45 | [>>>>>] ir para o ultimo bloco 46 | temos os dois valores 47 | no ultimo bloco vamos 48 | calcular a media agora 49 | >>>[-<+>>>+<<]>>[-<<+>>]<<<<< 50 | >>>>[->+<<<+>>]>[-<+>]<<<<< 51 | neste momento está 0 _ S V W 52 | vamos dividir por dois o S 53 | >>[ enquanto houver S 54 | [>>>+>+<<<<-]>>>>[<<<<+>>>>-]<<<< fazer uma copia do S 55 | <<+>>>>> ligar o U 56 | -[ se S2 for maior que 1 57 | <<<<<- desligar o U 58 | >>--<+< remover 2 do S e aumentar 1 o D 59 | >>>>>[-] apagar o S2 60 | ]<<<<< 61 | [->>-<<]>> se U apagar S e U 62 | ]<< 63 | >[->+<]< copiar o D para S 64 | agora está 0 _ M V W 65 | agora vamos copiar o W pro bloco seguinte 66 | >>>>[->>>>>+<<<<<]<<<< 67 | copiar o M pro fim do bloco e pro lugar do V no bloco seguinte 68 | >>[->>+>>>>+<<<<<<]<< 69 | primeiro bloco 70 | ++ 71 | >>>>[-<<+<+>>>]<<[->>+<<]<< 0 W _ V W 72 | >>>[-<+<->>]<[->+<]<< 0 W_V _ V W 73 | >-[<+>[-]]< 2/3 0 0 V W 74 | >>>>> 75 | segundo bloco 76 | ++ 77 | >>>>[-<<+<+>>>]<<[->>+<<]<< 0 W _ V W 78 | >>>[-<+<->>]<[->+<]<< 0 W_V _ V W 79 | >-[<+>[-]]< 2/3 0 0 V W 80 | ----[++++<<<<<----]++++ encontrar o bloco 81 | -- marcar o bloco como 2 82 | --] fim de if 83 | ++ 84 | >>>>>] fim de while 85 | o apontador esta no fim dos blocos que ja estao divididos 86 | prontos a serem usados para a ordenacao 87 | <<<<< avancar para o ultimo bloco criado acima 88 | [ se o bloco nao for nulo que indica que tem que ser aplicado 89 | + marcalo com valor 3 90 | copiar os valores para o primeiro bloco indicado pelo valor 1 91 | >>>[-<<< 92 | -[+<<<<<-]+ ir para o bloco 93 | >>>+<<< 94 | ---[+++>>>>>---]+++ 95 | >>>]<<< 96 | >>>>[-<<<< 97 | -[+<<<<<-]+ ir para o bloco 98 | >>>>+<<<< 99 | ---[+++>>>>>---]+++ 100 | >>>>]<<<< 101 | acabado de copiar os valores ir para o bloco com eles 102 | -[+<<<<<-]+ 103 | fazer aqui as cenas e tal tipo calcular a media outra vez 104 | e depois fazer as cenas subir pra coiso 105 | copiar os valores pra baixo duplicando os pelo caminho 106 | >>>[-<<+>>>>+<<] 107 | >[-<<+>>>>+<<]<<<< 108 | >[->>+>>>>+<<<<<<]< 109 | >>[->>+>>>>>+<<<<<<<]<< 110 | >>>[-<+>]>[-<<+>>]<<<< 111 | >>>>>>[-]<<<<<< 112 | divisao por 2 113 | >>[ 114 | [->+>+<<]>>[-<<+>>]<< 115 | >>+< 116 | -[ 117 | >- 118 | <<-- 119 | > >>>>>+<<+ <<< < 120 | >[-] 121 | ]< 122 | >>[-<<[-]>>]<< 123 | ]<< 124 | ja temos os dados no bloco primeiro 125 | 1 _ _ _ _ 126 | A B L M H 127 | _ _ _ _ _ 128 | calcular a soma das diferencas e verificar se é nula 129 | >>>>> 130 | A [->>>>>+<<<<< <+<<->>>]<[->+<]>> 131 | B [->>>>>+<<<<< <<+<->>>]<<[->>+<<]>>>> 132 | M [-<<<<+<<+>>>>>>]<<<<[->>>>+<<<<]>>>>> 133 | H [-<<<<<+<+>>>>>>]<<<<<[->>>>>+<<<<<] 134 | pointer no 5o byte do primeiro bloco 135 | > >>>>> [->-<] subtrair o A ao B 136 | > pointer no B de baixo ptr(11) 137 | [ se A for diferente de B 138 | [-]< <<<<< <<< 139 | pointer no DA 140 | contas manhosas pra calcular o DA&DB a partir do DA e do DB 141 | [ 142 | [->>+<<] mover o DA 143 | >[ ver do DB 144 | [->>>>>>>+<<<<<<<] move lo pra longe porque n ha espaco perto 145 | <<+>> 146 | ]< 147 | ] 148 | >>[-<<+>>]< restaurar o DA 149 | >>>>>>>[-<<<<<<<+>>>>>>>]<<<<<<< 150 | << 151 | enquanto DA&DB temos que ir ver qual é o menor portanto 152 | vamos busca los la abaixo 153 | [ 154 | o pointer tá no DA&DB 155 | buscar o A e ptr(10) 156 | >>>> meter o pointer no A 157 | [->>>>>+>+<<<<<<]>>>>>[-<<<<<+>>>>>]<<<<< 158 | > meter o pointer no B 159 | [->>>>+>>+<<<<<<]>>>>[-<<<<+>>>>] 160 | 161 | +> marcar isto como 1 e meter o pointer no A2 162 | copiar o A2 pra baixo e tal 163 | [->>>>> >>>>>+<<<<< <<<<<]>>>>> >>>>> 164 | 165 | estamos no primeiro numero (5) com A na segunda casa 166 | [ enquanto houver numero 167 | remover um e copiar pro proximo 168 | -[->>>>>+<<<<<]>>>>> 169 | ] 170 | <+ marcar este cagalhoto como 6 171 | duplicar o numero 172 | >>>>[-<<+<+>>>] 173 | <<[->>+<<]<< 174 | >[-< -[+<<<<<-]+ >>>+<<< ------[++++++>>>>>------]++++++ >]< 175 | - desmarcar o cagalhoto 176 | -[+<<<<<-]+ procurar o 1 177 | buscar o B e ptr(10) 178 | >> pointer no B2 179 | [->>>>> >>>>+<<<<< <<<<]>>>>> >>>> 180 | estamos no primeiro numero (5) com B na segunda casa 181 | [ enquanto houver numero 182 | remover um e copiar pro proximo 183 | -[->>>>>+<<<<<]>>>>> 184 | ] 185 | <++ marcar este cagalhoto como 7 186 | duplicar o numero 187 | >>>>[-<<+<+>>>] 188 | <<[->>+<<]<< 189 | >[-< 190 | -[+<<<<<-]+ 191 | >>>>+<<<< 192 | -------[+++++++>>>>>------- 193 | ]+++++++ >]< 194 | -- desmarcar o cagalhoto 195 | -[+<<<<<-]+ procurar o 1 196 | ja temos o pointer no 1 e os valores v(A) e v(B) tambem ja estao cá 197 | ver qual é o maior dos dois; 198 | (1) _ _ vA vB 199 | less_than(13;14;18); 200 | copy(X(13);18;17) 201 | >>> [->>>>+>+<<<<<] >>>>[-<<<<+>>>>]<<<< <<< 202 | copy(Y(14);19;17) 203 | >>>> [->>>+>>+<<<<<] >>>[-<<<+>>>]<<< <<<< 204 | meter o pointer no segundo vA(18) 205 | >>>>> >>> 206 | while (18) 207 | [ 208 | - dec(18) 209 | while (19) 210 | >[ 211 | <<<+>>> inc(16) 212 | - dec(19) 213 | [-<<<<+>>>>] move(19;15) 214 | ] 215 | <<<<[->>>>+<<<<] move(15;19) 216 | >>> 217 | ] 218 | ptr(10) 219 | <<< <<<<< 220 | copy(X(13);18;17) 221 | >>> [->>>>+>+<<<<<] >>>>[-<<<<+>>>>]<<<< <<< 222 | copy(Y(14);19;17) 223 | >>>> [->>>+>>+<<<<<] >>>[-<<<+>>>]<<< <<<< 224 | ptr(16) 225 | >>>>> > 226 | subtract_to(16;{18;19}) 227 | [->>->-<<<] 228 | ptr(10) 229 | < <<<<< 230 | o ptr está no 10 231 | ver qual numero e pra onde levar mudando o A/B e DA/DB e ptr(19) 232 | calcular destino 233 | ptr(9) copy(9;{11;16};12) 234 | <[->>+>+<<<]>>>[-<<<+>>>]<<< 235 | ptr(2) subtract_to(2;11;4) 236 | <<<< <<< [->>+> >>>>> >-< <<<<< <<<]>>[-<<+>>]<< 237 | ptr(3) subtract_to(3;11;4) 238 | > [->+> >>>>> >-< <<<<< <<]>[-<+>]< 239 | fazer punhes 240 | ptr(2) dec(2) 241 | <- 242 | ptr(5) inc(5) 243 | >>> + 244 | ptr(18) 245 | >>>>> >>>>> >>> 246 | while(18) OU SEJA o B é menor que A 247 | [ 248 | ptr(6) inc(6) 249 | <<< <<<<< <<<< + 250 | ptr(5) dec(5) 251 | < - 252 | ptr(3) dec(3) 253 | << - 254 | ptr(2) inc(2) 255 | < + 256 | ptr(13) 257 | >>> >>>>> >>> 258 | swap(13;14;12) 259 | [-<+>]>[-<+>]<<[->>+<<]> 260 | ptr(18) 261 | >> >>> 262 | clear(18) 263 | [-] 264 | ] 265 | ptr(19) 266 | > 267 | clear(19) 268 | [-] 269 | ptr(11) 270 | <<<< <<<< 271 | levar o 13 pro mark(5) indicado pelo 11 e voltar pro mark(1) aka ptr(10) 272 | move(11;21) 273 | [- >>>>> >>>>>+<<<<< <<<<<] 274 | ptr(13) move(13;{22}) 275 | >> 276 | [->> >>>>> >>+<< <<<<< <<] 277 | ptr(14) clear(14) 278 | >[-] 279 | ptr(20) 280 | > >>>>> 281 | >[ 282 | dec(mark(5):1) move(mark(5):1;mark(5):6) 283 | -[->>>>>+<<<<<] 284 | ptr(mark(5):2) move(mark(5):2;mark(5):7) 285 | >[->>>>>+<<<<<] 286 | ptr(mark(5):6) 287 | >>>> 288 | ]< 289 | estamos num mark(5) e é preciso mover o :2 pro :3 290 | >>[->+<]<< 291 | voltar pro mark(1) 292 | -[+<<<<<-]+ 293 | - desmarca lo 294 | ptr(1) aka DA&DB 295 | <<<<< 296 | <<<< 297 | 298 | recalcular DA&DB com ptr(1) 299 | o pointer aqui tem que estar no DA&DB 300 | and(2;3;1;{4;10}) 301 | [-] 302 | >[ 303 | ptr(4) clear(4) ptr(2) 304 | >>[-]<< 305 | move(2;4) 306 | [->>+<<] 307 | >[ 308 | [->>>>>>>+<<<<<<<] move(3;10) 309 | <<+>> ptr(1) inc(1) ptr(3) 310 | ]< ptr(4) 311 | ] 312 | >>[-<<+>>]< move(4;2) 313 | >>>>>>>[-<<<<<<<+>>>>>>>]<<<<<<< move(10;3) 314 | << ptr(1) 315 | ] 316 | pointer no DA&DB ptr(1) 317 | ptr(2) 318 | > 319 | [ copiar os da primeira metade pro final destination 320 | marcar 10 321 | ptr(10) inc(10) ptr(5) 322 | >>> >>>>> + <<<<< 323 | copy(5;21;11) ptr(11) 324 | [->>>>> >+>>>> >>>>> >+< <<<<< <<<<< <<<<<]+>>>>> >[-< <<<<<+>>>>> >] 325 | ptr(21) 326 | >>>>> >>>>> 327 | [-[->>>>>+<<<<<]>>>>>]< 328 | >>>>[-<<+<+>>>]<<<< >>[->>+<<]<< 329 | -[+ >[-<<<<<+>>>>>]< <<<<<-]+ 330 | >[->+<]< 331 | estamos em ptr(10) 332 | copy(9;11;13) 333 | < [->>+>>+<<<<] >>>>[-<<<<+>>>>]<<< 334 | subtract_to(2;11;4) 335 | <<<<< <<< [->>+> >>>>> >-< <<<<< <<<]>>[-<<+>>]< 336 | subtract_to(3;11;4) 337 | [->+> >>>>> >-< <<<<< <<]>[-<+>]> >>>>> 338 | >[->>>>> >>>>>+<<<<< <<<<<]< 339 | >>[->>>>> >>>>>+<<<<< <<<<<]<< 340 | >>>>> >>>>> 341 | >[ 342 | -[->>>>>+<<<<<] 343 | >[->>>>>+<<<<<]< 344 | >>>>> 345 | ]< 346 | >>[->+<]<< 347 | -[+<<<<<-]+ 348 | desmarcar 349 | - 350 | ptr(2) dec(2) 351 | <<<<< <<< - 352 | ] 353 | ptr(3) 354 | > 355 | [ copiar os da primeira metade pro final destination 356 | marcar 10 357 | ptr(10) inc(10) ptr(6) 358 | >> >>>>> + <<<< 359 | copy(6;21;11) ptr(11) 360 | [->>>> >+>>>> >>>>> >+< <<<<< <<<<< <<<<]+>>>> >[-< <<<<+>>>> >] 361 | ptr(21) 362 | >>>>> >>>>> 363 | [-[->>>>>+<<<<<]>>>>>]< 364 | >>>>[-<<+<+>>>]<<<< >>[->>+<<]<< 365 | -[+ >[-<<<<<+>>>>>]< <<<<<-]+ 366 | >[->+<]< 367 | estamos em ptr(10) 368 | copy(9;11;13) 369 | < [->>+>>+<<<<] >>>>[-<<<<+>>>>]<<< 370 | subtract_to(2;11;4) 371 | <<<<< <<< [->>+> >>>>> >-< <<<<< <<<]>>[-<<+>>]< 372 | subtract_to(3;11;4) 373 | [->+> >>>>> >-< <<<<< <<]>[-<+>]> >>>>> 374 | estamos em 10 375 | >[->>>>> >>>>>+<<<<< <<<<<]< 376 | >>[->>>>> >>>>>+<<<<< <<<<<]<< 377 | >>>>> >>>>> 378 | >[ 379 | -[->>>>>+<<<<<] 380 | >[->>>>>+<<<<<]< 381 | >>>>> 382 | ]< 383 | >>[->+<]<< 384 | -[+<<<<<-]+ 385 | estamos em 10 outra vez 386 | desmarcar 387 | - 388 | ptr(3) dec(3) 389 | <<<<< << - 390 | ] 391 | assentar os valores do array temporario 392 | move(7;21) 393 | move(9;22) 394 | 395 | >> >>[->>> >>>>> >>>>> >+< <<<<< <<<<< <<<] 396 | >>[-> >>>>> >>>>> >>+<< <<<<< <<<<< <] 397 | aproveitar e marcar o 10 398 | > + 399 | 400 | >>>>> >>>>> 401 | >[-[->>>>>+<<<<<] >-[->>>>>+<<<<<]< >>>>>]< 402 | >>[-[->>>>>+<<<<<]>>[-]<< >[->+<]< >>>>>]<< 403 | -[+<<<<<-]+ 404 | - 405 | voltar a meter o pointer no B de baixo 406 | ptr(11) 407 | > 408 | [-] 409 | ] 410 | voltar a meter o pointer no inicio do bloco 1 411 | < <<<<< <<<<< 412 | 413 | pointer no inicio do bloco 1 414 | limpar as cenas no bloco 1 415 | >[-]>[-]>[-]>[-]> 416 | [-]>[-]>[-]>[-]>[-]> 417 | [-]>[-]>[-]>[-]>[-]> 418 | [-]>[-]>[-]>[-]>[-] 419 | <<<< 420 | <<<<< 421 | <<<<< 422 | <<<<< 423 | 424 | ---[+++>>>>>---]+++ ir para o bloco marcado 425 | --- eliminar o bloco 426 | <<<<< avançar para o proximo bloco 427 | ] 428 | imprimir as vaquinhas como letras de B a K 429 | -[+<<<<<-]+ 430 | -----[+++++>>>>>-----]+++++ 431 | [ 432 | >>>> 433 | +++++ +++++ 434 | +++++ +++++ 435 | +++++ +++++ 436 | +++++ +++++ 437 | +++++ +++++ 438 | +++++ +++++ 439 | +++++ 440 | . 441 | ----- ----- 442 | ----- ----- 443 | ----- ----- 444 | ----- ----- 445 | ----- ----- 446 | ----- ----- 447 | ----- 448 | < 449 | +++++ +++++ +++++ +++++ +++++ +++++ ++ 450 | . 451 | ----- ----- ----- ----- ----- ----- -- 452 | >> 453 | ] 454 | +++++ +++++.----- ----- 455 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 All Algorithms and its contributors (allalgorithms.com) 4 | Copyright (c) 2018 Carlos Abraham (abranhe.com) 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | We are accepting all pull requests. [Read More](https://github.com/AllAlgorithms/algorithms/issues/40) 2 | 3 |
4 |
5 |
6 |
7 |
8 | Algorithms Logo 9 |
10 |
11 |
12 |
13 |
14 |
15 | 16 |

17 | What is an algorithm?    18 | Contributing    19 | Stickers & T-Shirts 20 |

21 | 22 | 23 |

24 | 25 | Twitter 26 |     27 | 28 | Instagram 29 |     30 | 31 | Github 32 |     33 |

34 | 35 |
36 |

37 | Huge collection of All ▲lgorithms implemented in multiple languages 38 |

39 |
40 | 41 | 42 | 43 | 44 | 45 | 46 |
47 | 48 | ## See 49 | 50 | - [What is an algorithm](#what-is-an-algorithm) 51 | - [Contributing](https://github.com/AllAlgorithms/algorithms/blob/master/.github/contributing.md) 52 | - [Code of Conduct](https://github.com/AllAlgorithms/algorithms/blob/master/.github/code-of-conduct.md) 53 | - [Stickers and T-Shirts](https://www.redbubble.com/people/abranhe/works/34285088) 54 | - [Twitter](https://twitter.com/AllAlgorithms) 55 | - [Instagram](https://instagram.com/AllAlgorithms) 56 | - [Algorithms Categories](#categories) 57 | - [Maintainers](#maintainers) 58 | - [License](#license) 59 | 60 | 61 | ## What is an algorithm? 62 | 63 | Informally, an algorithm is any well-defined computational procedure that takes 64 | some value, or set of values, as input and produces some value, or set of values, as 65 | output. An algorithm is thus a sequence of computational steps that transform the 66 | input into the output. 67 | 68 | An algorithm should have three important characteristics to be considered valid: 69 | 70 | - **It should be finite**: If your algorithm never ends trying to solve the problem 71 | it was designed to solve then it is useless 72 | - **It should have well defined instructions**: Each step of the algorithm has to 73 | be precisely defined; the instructions should be unambiguously specified for each case. 74 | - **It should be effective**: The algorithm should solve the problem it was designed 75 | to solve. And it should be possible to demonstrate that the algorithm converges with 76 | just a paper and pencil. 77 | 78 | ## Categories 79 | 80 | > Structure of The All ▲lgoritms project 81 | 82 | - [Artificial Intelligence](#artificial-intelligence) 83 | - [Backtracking](#backtracking) 84 | - [Bit Manipulation](#bit-manipulation) 85 | - [Cellular Automaton](#cellular-automaton) 86 | - [Ciphers](#ciphers) 87 | - [Computational Geometry](#computational-geometry) 88 | - [Cryptography](#cryptography) 89 | - [Data Structures](#data-structures) 90 | - [Divide and conquer](#divide-and-conquer) 91 | - [Dynamic Programming](#dynamic-programming) 92 | - [Gaming Theory](#gaming-theory) 93 | - [Graphs](#graphs) 94 | - [Greedy Algorithms](#greedy-algorithms) 95 | - [Math](#math) 96 | - [Networking](#networking) 97 | - [Numerical Analysis](#numerical-analysis) 98 | - [Operating system](#operating-system) 99 | - [Randomized Algorithms](#randomized-algorithms) 100 | - [Searches](#searches) 101 | - [Selections Algorithms](#selections-algorithms) 102 | - [Sorting](#sorting) 103 | - [Strings](#strings) 104 | - [Online Challenges](#online-challenges) 105 | - [Others](#others) 106 | 107 | ## [Artificial Intelligence](artificial-intelligence) 108 | 109 | - [Density-based spatial clustering of applications with noise (DBSCAN Clustering)](https://allalgorithms.com/docs/dbscan) 110 | - [Interactive Self-Organizing Data Analysis Technique yAy! (ISODATA Clustering)](https://allalgorithms.com/docs/isodata) 111 | - [Linear Regression](https://allalgorithms.com/docs/linear-regression) 112 | - [Logistic Regression](https://allalgorithms.com/docs/logistic-regression) 113 | - [Neutral Style Transfer](https://allalgorithms.com/docs/neutral-style-transfer) 114 | - [SATisfiable (SAT)](https://allalgorithms.com/docs/sat) 115 | - [Travelling salesman problem (TSP)](https://allalgorithms.com/docs/tsp) 116 | - [A* (A Star)](https://allalgorithms.com/docs/a-star) 117 | - [Artificial Neutral Network](https://allalgorithms.com/docs/artificial-neutral-network) 118 | - [Convolutional Neutral Network](https://allalgorithms.com/docs/convolutional-neutral-network) 119 | - [Decision Tree](https://allalgorithms.com/docs/decision-tree) 120 | - [Factorization Machines](https://allalgorithms.com/docs/factorization-machines) 121 | - [Gaussian Mixture Model](https://allalgorithms.com/docs/gaussian-mixtrue-model) 122 | - [Gradient Boosting Trees](https://allalgorithms.com/docs/gradient-boostring-trees) 123 | - [Hierachical Clustering](https://allalgorithms.com/docs/hierachical-clustering) 124 | - [Image Processing](https://allalgorithms.com/docs/image-processing) 125 | - [K Nearest Neighbors](https://allalgorithms.com/docs/k-nearest-neighbors) 126 | - [K Means](https://allalgorithms.com/docs/k-means) 127 | - [Minimax](https://allalgorithms.com/docs/minimax) 128 | - [Native Bayes](https://allalgorithms.com/docs/native-bayes) 129 | - [Nearest Sequence Memory](https://allalgorithms.com/docs/nearest-sequence-memory) 130 | - [Neutral Network](https://allalgorithms.com/docs/neutral-network) 131 | - [Perceptron](https://allalgorithms.com/docs/perceptron) 132 | - [Principal Component Analysis](https://allalgorithms.com/docs/principal-component-analysis) 133 | - [Q Learing](https://allalgorithms.com/docs/q-learning) 134 | - [Random Forests](https://allalgorithms.com/docs/random-forest) 135 | - [Restricted Boltzman Machine](https://allalgorithms.com/docs/restricted-boltzman-machine) 136 | 137 | ## [Backtracking](backtracking) 138 | 139 | - [Algorithm X](backtracking/algorithm-x) 140 | - [Crossword Puzzle](backtracking/crossword-Puzzle) 141 | - [Knight Tour](backtracking/knight-tour) 142 | - [M Coloring Problem](backtracking/m-coloring-problem) 143 | - [N Queen](backtracking/n-queen) 144 | - [Number of ways in Maze](backtracking/number-of-ways-in-maze) 145 | - [Partitions of set](backtracking/partitions-of-set) 146 | - [Permutation of Strings](backtracking/permutation-of-strings) 147 | - [Powerset](backtracking/powerset) 148 | - [Rat in maze](backtracking/rat-in-maze) 149 | - [Subset Sum](backtracking/subset-sum) 150 | - [Sudoku Solve](backtracking/sudoku-solve) 151 | 152 | ## [Bit Manipulation](bit-manipulation) 153 | 154 | - [Addition using bits](bit-manipulation/adding-using-bits) 155 | - [Bit divisor](bit-manipulation/bit-divisor) 156 | - [Byte swapper](bit-manipulation/byte-swapper) 157 | - [Convert numbers to binary](bit-manipulation/convert-numbers-to-binary) 158 | - [Count set bits](bit-manipulation/count-set-bits) 159 | - [Flip bits](bit-manipulation/flip-bits) 160 | - [Hamming distance](bit-manipulation/hamming-distace) 161 | - [Invert bit](bit-manipulation/invert-bit) 162 | - [Lonely integer](bit-manipulation/lonely-integer) 163 | - [Magic Number](bit-manipulation/magic-number) 164 | - [Maximum XOR Value](bit-manipulation/maximun-xor-value) 165 | - [Power of 2](bit-manipulation/power-of-2) 166 | - [Subset Generation](bit-manipulation/subset-generation) 167 | - [Sum binary numbers](bit-manipulation/sum-binary-numbers) 168 | - [Sum equals XOR](bit-manipulation/sum-equals-xor) 169 | - [Thrice unique number](bit-manipulation/thrice-unique-number) 170 | - [Twice unique number](bit-manipulation/twice-unique-number) 171 | - [XOR Swap](bit-manipulation/xor-swap) 172 | 173 | ## [Cellular Automaton](cellular-automaton) 174 | 175 | - [Brians Brain](cellular-automaton/brians-brain) 176 | - [Conways Game of life](cellular-automaton/conways-game-of-life) 177 | - [Elementary Cellular Automata](cellular-automaton/elementary-cellular-automata) 178 | - [Generic Algorithm](cellular-automaton/generic-algorithm) 179 | - [Langtons Ant](cellular-automaton/langtons-ant) 180 | - [Nobili Cellular Automata](cellular-automaton/nobili-cellular-automata) 181 | - [Von Neoumann Cellular Automata](cellular-automaton/von-neoumann-cellular-automata) 182 | 183 | ## [Computational Geometry](computational-geometry) 184 | 185 | - [2D Line intersection](computational-geometry/) 186 | - [2D Separating Axis test](computational-geometry/) 187 | - [Area of polygon](computational-geometry/) 188 | - [Area of triangle](computational-geometry/) 189 | - [Axis aligned bounding box collision](computational-geometry/) 190 | - [Bresenham Line](computational-geometry/) 191 | - [Chans Algorithm](computational-geometry/) 192 | - [Cohen Sutherland Lineclip](computational-geometry/) 193 | - [Distance between points](computational-geometry/) 194 | - [Graham Scan](computational-geometry/) 195 | - [Halfplane intersection](computational-geometry/) 196 | - [Jarvis March](computational-geometry/) 197 | - [Quickull](computational-geometry/) 198 | - [Sphere tetrahedron intersection](computational-geometry/) 199 | - [Sutherland Hodgeman clipping](computational-geometry/) 200 | 201 | ## [Cryptography](cryptography) 202 | 203 | - [Affine Cipher](cryptography/) 204 | - [Atbash Cipher](cryptography/) 205 | - [Autokey Cipher](cryptography/) 206 | - [Baconian Cipher](cryptography/) 207 | - [Caesar Cipher](cryptography/) 208 | - [Colummnar Cipher](cryptography/) 209 | - [Vigenere Cipher](cryptography/) 210 | 211 | ## [Data Structures](data-structures) 212 | 213 | - [Bag](data-structures/bag/) 214 | - [Hashes](data-structures/hashes/) 215 | - [Linked List](data-structures/linked-list/) 216 | - [List](data-structures/list/) 217 | - [Queue](data-structures/queue/) 218 | - [Stack](data-structures/stack/) 219 | - [Tree](data-structures/tree/) 220 | 221 | ## [Divide and conquer](divide-and-conquer) 222 | 223 | - [Strassen Matrix Manipulation](divide-and-conquer/) 224 | - [Closest Pair of Point](divide-and-conquer/) 225 | - [Inversion Count](divide-and-conquer/) 226 | - [Karatsuba Multiplication](divide-and-conquer/) 227 | - [Maximum Contiguous subsequence sum](divide-and-conquer/) 228 | - [Merge Sort using divide and conquer](divide-and-conquer/) 229 | - [Quick Sort using divide and conquer](divide-and-conquer/) 230 | - [Tournament Method to find min max](divide-and-conquer/) 231 | - [Warnock Algorithm](divide-and-conquer/) 232 | - [X Power Y](divide-and-conquer/) 233 | 234 | ## [Dynamic Programming](dynamic-programming) 235 | 236 | - [Array Median](dynamic-programming) 237 | - [Optima Binary Search Tree](dynamic-programming) 238 | - [Binomial Coefficient](dynamic-programming) 239 | 240 | ## [Gaming Theory](gaming-theory) 241 | 242 | - [Nim Next Best Move Game](gaming-theory/) 243 | - [Nim Win Loss Game](gaming-theory/) 244 | - [Grundy Numbers Kayle Game](gaming-theory/) 245 | 246 | ## [Graphs](graphs) 247 | 248 | - [Bipartite Check](graphs/) 249 | - [Adjacency Lists graphs representation](graphs/) 250 | - [A* (A Star)](https://allalgorithms.com/docs/a-star) 251 | 252 | ## [Greedy Algorithms](greedy-algorithms) 253 | 254 | - [Activity Selection](greedy-algorithms) 255 | - [Dijkstra Shortest Path](greedy-algorithms) 256 | - [Egyptian Fraction](greedy-algorithms) 257 | 258 | ## [Math](math) 259 | 260 | - [2 Sum](math/) 261 | - [Add Polynomials](math/) 262 | - [Amicable Numbers](math/) 263 | - [Armstrong Numbers](math/) 264 | - [Automorphic Numbers](math/) 265 | - [Average Stream Numbers](math/) 266 | - [Babylonian Method](math/) 267 | - [Binomial Coefficient](math/) 268 | - [Catalan Number](math/) 269 | - [Check is Square](math/) 270 | - [Convolution](math/) 271 | - [Coprime Numbers](math/) 272 | - [Count Digits](math/) 273 | - [Count Trailing Zeroes](math/) 274 | - [Decoding of String](math/) 275 | - [Delannoy Number](math/) 276 | - [Derangements](math/) 277 | - [DFA Division](math/) 278 | - [Diophantine](math/) 279 | - [Divided Differences](math/) 280 | - [Euler Totient](math/) 281 | - [Exponentiation Power](math/) 282 | - [Factorial](math/factorial) 283 | - [Fast Fourier transform](math/) 284 | - [Fast inverse (sqrt) Square Root](math/) 285 | 286 | ## [Networking](networking) 287 | 288 | - [Packet Sniffer](networking/) 289 | - [Determine Endianess](networking/) 290 | - [Validate IP](networking/) 291 | 292 | ## [Numerical Analysis](numerical-analysis) 293 | 294 | - [Integral](numerical-analysis/integral) 295 | - [Monte Carlo](numerical-analysis/monte-carlo) 296 | - [Runge Kutt](numerical-analysis/runge-kutt) 297 | 298 | ## [Operating system](operating-system) 299 | 300 | - [Currency](operating-system/) 301 | - [Deadlocks](operating-system/) 302 | - [Memory Management](operating-system/) 303 | - [Scheduling](operating-system/) 304 | - [Shell](operating-system/) 305 | 306 | ## [Randomized Algorithms](randomized-algorithms) 307 | 308 | - [Birthday Paradox](randomized-algorithms) 309 | - [Karger Minimum Cut Algorithm](randomized-algorithms) 310 | - [Kth Smallest Element Algorithm](randomized-algorithms) 311 | - [Random from Stream](randomized-algorithms) 312 | - [Random Node Linked list](randomized-algorithms) 313 | - [Randomized Quicksort](randomized-algorithms) 314 | - [Reservoir Sampling](randomized-algorithms) 315 | - [Shuffle an Array](randomized-algorithms) 316 | 317 | ## [Searches](searches) 318 | 319 | - [Binary Search](searches) 320 | - [Exponential Search](searches) 321 | - [Fibonacci Search](searches) 322 | - [Fuzzy Search](searches) 323 | - [Interpolation Search](searches) 324 | - [Jump Search](searches) 325 | - [Linear Search](searches) 326 | - [Ternay Search](searches) 327 | 328 | ## [Selections Algorithms](selections-algorithms) 329 | 330 | - [Median of Medians](selections-algorithms) 331 | - [Quick Select](selections-algorithms) 332 | 333 | ## [Sorting](sorting) 334 | 335 | - [Bead Sort](sorting/) 336 | - [Bogo Sort](sorting/) 337 | - [Bubble Sort](sorting/) 338 | - [Bucket Sort](sorting/) 339 | - [Circle Sort](sorting/) 340 | - [Comb Sort](sorting/) 341 | - [Counting Sort](sorting/) 342 | - [Cycle Sort](sorting/) 343 | - [Flash Sort](sorting/) 344 | - [Gnome Sort](sorting/) 345 | - [Heap Sort](sorting/) 346 | - [Insertion Sort](sorting/) 347 | - [Intro Sort](sorting/) 348 | - [Median Sort](sorting/) 349 | - [Merge Sort](sorting/) 350 | - [Pipeonhole Sort](sorting/) 351 | - [Quick Sort](sorting/) 352 | - [Radix Sort](sorting/) 353 | - [Selection Sort](sorting/) 354 | - [Shaker Sort](sorting/) 355 | - [Shell Sort](sorting/) 356 | - [Sleep Sort](sorting/) 357 | - [Stooge Sort](sorting/) 358 | - [Topological Sort](sorting/) 359 | - [Tree Sort](sorting/) 360 | 361 | ## [Strings](strings) 362 | 363 | - [Aho Corasick Algorithm](strings) 364 | - [Anagram Search](strings) 365 | - [Arithmetic on large numbers](strings) 366 | - [Boyer Moore Algorithm](strings) 367 | - [Finite Automata](strings) 368 | - [Kasai Algorithm](strings) 369 | - [Kmp Algorithm](strings) 370 | - [Levenshteing Distance](strings) 371 | - [Lipogram Checker](strings) 372 | 373 | ## [Online Challenges](online-challenges) 374 | 375 | - [Coderbyte](online-challenges/coderbyte) 376 | - [Code Chef](online-challenges/code-chef) 377 | - [Code Eval](online-challenges/code-eval) 378 | - [Hackerearth](online-challenges/hackerearth) 379 | - [Hackerrank](online-challenges/hackerrank) 380 | - [LeetCode](online-challenges/leetcode) 381 | - [Project Euler](online-challenges/project-euler) 382 | - [Rosalind](online-challenges/rosalind) 383 | - [SPOJ](online-challenges/spoj) 384 | - [Top Coder](online-challenges/top-coder)` 385 | 386 | ## [Others](others) 387 | 388 | - [Average](others/) 389 | - [Biggest of n numbers](others/) 390 | - [Biggest Suffix](others/) 391 | - [Fifteen Puzzle](others/) 392 | - [Jaccard Similarity](others/) 393 | - [Jose Phus Problem](others/) 394 | - [Lapindrom Checker](others/) 395 | - [Leap Year](others/) 396 | - [Magic Square](others/) 397 | - [Majority Element](others/) 398 | - [Minimum subarray size with degree](others/) 399 | - [No operator addition](others/) 400 | - [Paint fill](others/) 401 | - [Split list](others/) 402 | - [Tokenizer](others/) 403 | - [Unique number](others/) 404 | 405 | ## License 406 | 407 | This work is released under MIT License. 408 | 409 | To the extent possible under law, [Abraham Hernandez (@abranhe)](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. 410 | 411 |
412 | 413 | 414 | 415 |
416 |
-------------------------------------------------------------------------------- /src/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllAlgorithms/brainfuck/75e9d7b52cb2f6a6e823599971974b830c664fb9/src/.gitkeep --------------------------------------------------------------------------------