Open cozek opened 4 years ago
Dear @cozek , I've sent PR for adding Fibonacci series to Math. please feel free to comment or ask for any changes.
I've also sent PR for adding algorithm of factorial to Math.
I've also sent PR for adding algorithm of factorial to Math.
I have merged your PR. Thank you for your contribution!
Thanks for your kind response. You should actually notice that you mustn't change the file name from factor.m to factorial.m, because Matlab already has a function with the same name and our factorial function will be unusable!
Thanks for your kind response. You should actually notice that you mustn't change the file name from factor.m to factorial.m, because Matlab already has a function with the same name and our factorial function will be unusable!
Seems like I did an oopsie. Hahaha. No matter, the name change is just for indexing purpose. I am sure our readers will notice the problem and change the file/function names accordingly. Or perhaps, we should leave a comment in the script making our readers aware.
EDIT: i changed it to find_factorial. I think that solves the issue.
@atousa1 @MaSi-dev I have added more problems to the math section, have a look! :)
I made a PR for an insertion sorting algorithm.
Hi, I will review it soon. Thanks!
On Sun, 2 Feb 2020 at 13:18, MatteoRaso notifications@github.com wrote:
I made a PR for an insertion sorting algorithm.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TheAlgorithms/MATLAB-Octave/issues/9?email_source=notifications&email_token=ACXBUNMJPJM2CTOUIMJ2S3LRAZ3GHA5CNFSM4I7HDDMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKRQEMY#issuecomment-581108275, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXBUNPLAAMW4GTWPNV4CL3RAZ3GHANCNFSM4I7HDDMA .
I made a PR for two image processing algorithms. Please review. I missed the guideline of 1 PR per algorithm, I'll keep it in mind for the future.
Hi all, I want to contribute the jump search algorithm:
function found_at = jump_search(arr, value)
% Contributed by - Harshit Pant, harshitpant83@gmail.com
% arr - The input array, should be sorted in ascending order.
% 'arr' can contain -ve numbers as well as non-integers.
% value - The value to be searched in the array.
% found_at - The index at which 'value' is found in 'arr'.
% -1 is returned if 'value' is not found in 'arr'.
n = length(arr);
% 'm' holds the block size
m = sqrt(n);
m = round(m);
low = 1;
high = 1 + m;
found_at = -1;
while arr(min(high, n)) < value
low = high;
high = high + m;
if low >= n
return;
endif;
endwhile;
while arr(low) < value
low = low + 1;
if low > min(high, n)
return;
endif;
endwhile;
if arr(low) == value
found_at = low;
endif;
endfunction;
% TEST:
% Save this file to your local computer, then use the command:
% jump_search([-11.1, -3.3, -1.3, 0.1, 1.5, 3.5, 3.9, 5.5, 7.5, 9.6, 13.7, 21.3, 35.9], 7.5)
% This should return, ans = 9.
% TODO - Transfer this test when automated testing functionality is added to this repository.
Is anyone available to review? I'd like to send a PR. Thankyou. (/cc @cozek, @Panquesito7 @ayaankhan98)
Hi all, I want to contribute the jump search algorithm:
function found_at = jump_search(arr, value) % Contributed by - Harshit Pant, harshitpant83@gmail.com % arr - The input array, should be sorted in ascending order. % 'arr' can contain -ve numbers as well as non-integers. % value - The value to be searched in the array. % found_at - The index at which 'value' is found in 'arr'. % -1 is returned if 'value' is not found in 'arr'. n = length(arr); % 'm' holds the block size m = sqrt(n); m = round(m); low = 1; high = 1 + m; found_at = -1; while arr(min(high, n)) < value low = high; high = high + m; if low >= n return; endif; endwhile; while arr(low) < value low = low + 1; if low > min(high, n) return; endif; endwhile; if arr(low) == value found_at = low; endif; endfunction; % TEST: % Save this file to your local computer, then use the command: % jump_search([-11.1, -3.3, -1.3, 0.1, 1.5, 3.5, 3.9, 5.5, 7.5, 9.6, 13.7, 21.3, 35.9], 7.5) % This should return, ans = 9. % TODO - Transfer this test when automated testing functionality is added to this repository.
Is anyone available to review? I'd like to send a PR. Thankyou. (/cc @cozek, @Panquesito7 @ayaankhan98)
Make a proper PR, maintainers will review.
Ok, thanks.
I have created a PR. Would you please review and suggest if any changes are required Thank you
EDIT 6/10/20: If you are making a PR for hacktoberfest, please say so in your PR description so that I can add the
hacktoberfest-accepted
label.This repo needs more algorithms. If you see any missing algorithms, kindly contribute. Hackotberfest participants are welcome! I will list some of the algorithms that are up for grabs. However, please check if the algorithm is already in our repo before you begin working. Feel free to help me add more items to the list. If you have any questions, ask away!
Some Guidelines:
x = y + z % adds two numbers
or is unnecessary.Sorting Algorithms:
Searching Algorithms:
Math:
Machine Learning: NOTE: Please try to use standard datasets for these problems that are freely available and perhaps popular, such as the iris dataset. Or datasets that are already inbuilt in Matlab/Octave.