| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,8 @@ | |||
| 1 | 1 | { | |
| 2 | 2 | "Knight’s tour problem": "A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path), the tour is closed, otherwise it is open.", | |
| 3 | 3 | "Complexity": { | |
| 4 | - "time": "Worst O(8<sup>N<sup>2</sup></sup>)", | ||
| 5 | - "space": "Worst O(N<sup>2</sup>)" | ||
| 4 | + "time": "Worst $$O(8^{N^{2}})$$", | ||
| 5 | + "space": "Worst $$O(N^2)$$" | ||
| 6 | 6 | }, | |
| 7 | 7 | "References": [ | |
| 8 | 8 | "<a href='https://en.wikipedia.org/wiki/Knight%27s_tour'>Wikipedia</a>" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,8 +5,8 @@ | |||
| 5 | 5 | "Searching" | |
| 6 | 6 | ], | |
| 7 | 7 | "Complexity": { | |
| 8 | - "time": "Worst O(N!)", | ||
| 9 | - "space": "Worst O(N)" | ||
| 8 | + "time": "Worst $$O(N!)$$", | ||
| 9 | + "space": "Worst $$O(N)$$" | ||
| 10 | 10 | }, | |
| 11 | 11 | "References": [ | |
| 12 | 12 | "<a href='http://www.geeksforgeeks.org/backtracking-set-3-n-queen-problem/'>geeksforgeeks</a>" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,8 @@ | |||
| 1 | 1 | { | |
| 2 | 2 | "Sieve of Eratosthenes": "Finding all prime numbers up to a given range.", | |
| 3 | 3 | "Complexity": { | |
| 4 | - "time": "O(n(log n)(log log n))", | ||
| 5 | - "space": "O(n<sup>1/2</sup>)" | ||
| 4 | + "time": "$$O(n\\,(log\\,n)(log\\,log\\,n))$$", | ||
| 5 | + "space": "$$O(n^{\\frac{1}{2}})$$" | ||
| 6 | 6 | }, | |
| 7 | 7 | "References": [ | |
| 8 | 8 | "<a href='https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes'>Wikipedia</a>" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,6 +11,20 @@ | |||
| 11 | 11 | <title>Algorithm Visualizer</title> | |
| 12 | 12 | <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto"> | |
| 13 | 13 | <link rel="stylesheet" href="public/algorithm_visualizer.min.css"> | |
| 14 | + <script type="text/x-mathjax-config"> | ||
| 15 | + MathJax.Hub.Config({ | ||
| 16 | + tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}, | ||
| 17 | + styles: { | ||
| 18 | + ".MJXc-display": { | ||
| 19 | + "display": "inline !important", | ||
| 20 | + "margin": "0 !important" | ||
| 21 | + }, | ||
| 22 | + } | ||
| 23 | + }); | ||
| 24 | + </script> | ||
| 25 | + <script type="text/javascript" async | ||
| 26 | + src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> | ||
| 27 | + </script> | ||
| 14 | 28 | </head> | |
| 15 | 29 | ||
| 16 | 30 | <body> | |
@@ -36,7 +50,6 @@ <h3> | |||
| 36 | 50 | <span class="btn-text">Generate</span> | |
| 37 | 51 | </div> | |
| 38 | 52 | </div> | |
| 39 | - | ||
| 40 | 53 | <div class="btn" id="btn_share"> | |
| 41 | 54 | <div class="wrapper"> | |
| 42 | 55 | <i class="fa fa-share" aria-hidden="true"></i> Share <input type="text" class="collapse" id="shared"> | |
@@ -109,6 +122,9 @@ <h3> | |||
| 109 | 122 | <a href="https://github.com/simonwhitaker/github-fork-ribbon-css"> | |
| 110 | 123 | <button class="indent">simonwhitaker/github-fork-ribbon-css</button> | |
| 111 | 124 | </a> | |
| 125 | + <a href="https://github.com/mathjax/MathJax"> | ||
| 126 | + <button class="indent">mathjax/MathJax</button> | ||
| 127 | + </a> | ||
| 112 | 128 | </div> | |
| 113 | 129 | </div> | |
| 114 | 130 | <a class="github-fork-ribbon left-bottom" href="http://github.com/parkjs814/AlgorithmVisualizer" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,11 +1,7 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | 3 | const app = require('../app'); | |
| 4 | - | ||
| 5 | - const { | ||
| 6 | - isScratchPaper | ||
| 7 | - } = require('../utils'); | ||
| 8 | - | ||
| 4 | + const utils = require('../utils'); | ||
| 9 | 5 | const showDescription = require('./show_description'); | |
| 10 | 6 | const addFiles = require('./add_files'); | |
| 11 | 7 | ||
@@ -14,7 +10,7 @@ module.exports = (category, algorithm, data, requestedFile) => { | |||
| 14 | 10 | let category_name; | |
| 15 | 11 | let algorithm_name; | |
| 16 | 12 | ||
| 17 | - if (isScratchPaper(category)) { | ||
| 13 | + if (utils.isScratchPaper(category)) { | ||
| 18 | 14 | $menu = $('#scratch-paper'); | |
| 19 | 15 | category_name = 'Scratch Paper'; | |
| 20 | 16 | algorithm_name = algorithm ? 'Shared' : 'Temporary'; | |
@@ -45,4 +41,5 @@ module.exports = (category, algorithm, data, requestedFile) => { | |||
| 45 | 41 | ||
| 46 | 42 | showDescription(data); | |
| 47 | 43 | addFiles(category, algorithm, files, requestedFile); | |
| 44 | + utils.renderMathJax(); | ||
| 48 | 45 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,8 +14,13 @@ const getFileDir = (category, algorithm, file) => { | |||
| 14 | 14 | return `./algorithm/${category}/${algorithm}/${file}/`; | |
| 15 | 15 | }; | |
| 16 | 16 | ||
| 17 | + const renderMathJax = () =>{ | ||
| 18 | + MathJax.Hub.Queue(["Typeset",MathJax.Hub]); | ||
| 19 | + }; | ||
| 20 | + | ||
| 17 | 21 | module.exports = { | |
| 18 | 22 | isScratchPaper, | |
| 19 | 23 | getAlgorithmDir, | |
| 20 | - getFileDir | ||
| 21 | - }; | ||
| 24 | + getFileDir, | ||
| 25 | + renderMathJax | ||
| 26 | + }; | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments