Skip to content

Commit cbe7585

Browse files
committed
update
2 parents 131ae54 + 4793490 commit cbe7585

File tree

5 files changed

+13
-86
lines changed

5 files changed

+13
-86
lines changed

CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ This file lists everyone, who contributed to this repo and wanted to show up her
4343
- Vexatos
4444
- Björn Heinrichs
4545
- Olav Sundfør
46+
- dovisutu
47+
- Antetokounpo

contents/cooley_tukey/code/julia/fft.jl

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,17 @@ function butterfly(x)
110110
return y
111111
end
112112

113-
function approx(x, y)
114-
val = true
115-
for i = 1:length(x)
116-
if (abs(x[i]) - abs(y[i]) > 1e-5)
117-
val = false
118-
end
119-
end
120-
println(val)
121-
end
122-
123113
function main()
124114
x = rand(128)
125115
y = cooley_tukey(x)
126116
z = iterative_cooley_tukey(x)
127117
w = fft(x)
128-
approx(y, w)
129-
approx(z, w)
118+
if(isapprox(y, w))
119+
println("Recursive Cooley Tukey matches fft() from FFTW package.")
120+
end
121+
if(isapprox(z, w))
122+
println("Iterative Cooley Tukey matches fft() from FFTW package.")
123+
end
130124
end
131125

132126
main()

contents/graham_scan/code/julia/graham.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ end
4747
function main()
4848
# This hull is just a simple test so we know what the output should be
4949
points = [
50-
Point(-5.,2), Point(5,7), Point(-6,-12), Point(-14,-14), Point(9,9),
50+
Point(-5,2), Point(5,7), Point(-6,-12), Point(-14,-14), Point(9,9),
5151
Point(-1,-1), Point(-10,11), Point(-6,15), Point(-6,-8), Point(15,-9),
5252
Point(7,-7), Point(-2,-9), Point(6,-5), Point(0,14), Point(2,8)
5353
]

contents/jarvis_march/code/jarvis.jl

Lines changed: 0 additions & 69 deletions
This file was deleted.

contents/tree_traversal/code/c++/tree_example.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void dfs_recursive_postorder(node const& n) {
3232

3333

3434
void dfs_recursive_inorder_btree(node const& n) {
35-
switch (n.children_size) {
35+
switch (n.children.size()) {
3636
case 2:
3737
dfs_recursive_inorder_btree(n.children[0]);
3838
std::cout << n.value << '\n';
@@ -92,16 +92,16 @@ node create_tree(size_t num_row, size_t num_child) {
9292

9393
std::vector<node> vec;
9494
std::generate_n(std::back_inserter(vec), num_child, [&] {
95-
return create_node(num_row - 1, num_child);
95+
return create_tree(num_row - 1, num_child);
9696
});
9797

9898
return node{std::move(vec), num_row};
9999
}
100100

101101
int main() {
102102
// Creating Tree in main
103-
auto root = create_node(3, 3);
104-
auto binary_root = create_node(3, 2);
103+
auto root = create_tree(3, 3);
104+
auto binary_root = create_tree(3, 2);
105105
std::cout << "DFS recursive:\n";
106106
dfs_recursive(root);
107107
std::cout << "DFS post order recursive:\n";

0 commit comments

Comments
 (0)