Skip to content

Commit f039b39

Browse files
nadr0TornjV
authored andcommitted
all algorithms use mathjax for complexities (algorithm-visualizer#212)
1 parent 52dbc4c commit f039b39

File tree

54 files changed

+139
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+139
-145
lines changed

algorithm/backtracking/knight's_tour/desc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"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.",
33
"Complexity": {
4-
"time": "Worst $$O(8^{N^{2}})$$",
5-
"space": "Worst $$O(N^2)$$"
4+
"time": "Worst $O(8^{N^{2}})$",
5+
"space": "Worst $O(N^2)$"
66
},
77
"References": [
88
"<a href='https://en.wikipedia.org/wiki/Knight%27s_tour'>Wikipedia</a>"

algorithm/backtracking/n_queens/desc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"Searching"
66
],
77
"Complexity": {
8-
"time": "Worst $$O(N!)$$",
9-
"space": "Worst $$O(N)$$"
8+
"time": "Worst $O(N!)$",
9+
"space": "Worst $O(N)$"
1010
},
1111
"References": [
1212
"<a href='http://www.geeksforgeeks.org/backtracking-set-3-n-queen-problem/'>geeksforgeeks</a>"

algorithm/cryptography/affine_cipher/desc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"More complex Variations of Affine Cipher are used in practical cryptography"
66
],
77
"Complexity": {
8-
"time": "worst O(N), N = length of plain/cipher text",
9-
"space": "worst O(N), to create the new mapping (plain->cipher, cipher->plain)"
8+
"time": "worst $O(N)$, $N$ = length of plain/cipher text",
9+
"space": "worst $O(N)$, to create the new mapping (plain->cipher, cipher->plain)"
1010
},
1111
"References": [
1212
"<a href='http://practicalcryptography.com/ciphers/affine-cipher/'>Practicalcryptography</a>"

algorithm/dp/catalan_number/desc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"The number of ways to cut an n+2-sided convex polygon in a plane into triangles by connecting vertices with straight, non-intersecting lines is the nth Catalan number. This is the application in which Euler was interested."
77
],
88
"Complexity": {
9-
"time": " O(N<sup>2</sup>)",
10-
"space": "O(N)"
9+
"time": " $O(N^2)$",
10+
"space": "$O(N)$"
1111
},
1212
"References": [
1313
"<a href='https://en.wikipedia.org/wiki/Catalan_number'>Wikipedia</a>",
@@ -16,4 +16,4 @@
1616
"files": {
1717
"catalan_number": "Catalan Number"
1818
}
19-
}
19+
}

algorithm/dp/fibonacci/desc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"Fibonacci Sequence": "Finding Fibonacci sequence using dynamic programming.",
33
"Complexity": {
4-
"time": "O(n)",
5-
"space": "O(n)"
4+
"time": "$O(n)$",
5+
"space": "$O(n)$"
66
},
77
"References": [
88
"<a href='https://en.wikipedia.org/wiki/Dynamic_programming#Fibonacci_sequence'>Wikipedia</a>"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"Integer Partition": "In number theory and combinatorics, a partition of a positive integer n, also called an integer partition, is a way of writing n as a sum of positive integers.",
33
"Complexity": {
4-
"time": "O(n(log n))",
5-
"space": "O(n<sup>2</sup>)"
4+
"time": "$O(n(log \\, n))$",
5+
"space": "$O(n^2)$"
66
},
77
"References": [
88
"<a href='https://en.wikipedia.org/wiki/Partition_(number_theory)'>Wikipedia</a>"
99
],
1010
"files": {
1111
"basic": "Integer partition"
1212
}
13-
}
13+
}

algorithm/dp/knapsack_problem/desc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"Knapsack Problem": "Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.",
33
"Complexity": {
4-
"time": "O(n<sup>2</sup>)",
5-
"space": "O(n<sup>2</sup>)"
4+
"time": "$O(n^2)$",
5+
"space": "$O(n^2)$"
66
},
77
"References": [
88
"<a href='https://en.wikipedia.org/wiki/Knapsack_problem'>Wikipedia</a>"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"Longest Common Subsequence": "The longest common subsequence (LCS) problem is the problem of finding the longest subsequence common to all sequences in a set of sequences (often just two sequences)." ,
33
"Complexity": {
4-
"time": "O(mn)",
5-
"space": "O(mn)"
4+
"time": "$O(m\\cdot n)$",
5+
"space": "$O(m\\cdot n)$"
66
},
77
"References": [
88
"<a href='https://en.wikipedia.org/wiki/Longest_common_subsequence_problem'>Wikipedia</a>"
99
],
1010
"files": {
1111
"basic": "Longest common subsequence"
1212
}
13-
}
13+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"Longest Increasing Subsequence": "Find the length of the longest subsequence of a given sequence such that all elements of the subsequence are sorted in increasing order",
33
"Complexity": {
4-
"time": "O(n(log n))",
5-
"space": "O(n)"
4+
"time": "$O(n(log\\,n))$",
5+
"space": "$O(n)$"
66
},
77
"References": [
88
"<a href='https://en.wikipedia.org/wiki/Longest_increasing_subsequence'>Wikipedia</a>"
99
],
1010
"files": {
1111
"basic": "Longest increasing subsequence"
1212
}
13-
}
13+
}

algorithm/dp/longest_palindromic_subsequence/desc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"Longest Palindromic Subsequence": "Find the length of the longest palindromic subsequence in a given sequence",
33
"Complexity": {
4-
"time": "O(n<sup>2</sup>)",
5-
"space": "O(n<sup>2</sup>)"
4+
"time": "$O(n^2)$",
5+
"space": "$O(n^2)$"
66
},
77
"References": [
88
"<a href='http://www.geeksforgeeks.org/dynamic-programming-set-12-longest-palindromic-subsequence/'>GeeksForGeeks</a>"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy