Giter VIP home page Giter VIP logo

kennyledet / algorithm-implementations Goto Github PK

View Code? Open in Web Editor NEW
2.2K 2.2K 535.0 1.27 MB

Share, discuss and learn about algorithm implementations!

Home Page: http://algorithm.zone

License: MIT License

C# 7.79% C++ 5.29% C 4.79% Makefile 0.18% Go 5.79% Haxe 0.79% Java 13.24% JavaScript 3.79% Lua 33.78% Python 7.50% Ruby 2.87% Awk 0.20% Scala 3.96% Haskell 2.18% GAP 0.29% PHP 3.11% Objective-C 3.02% Perl 0.74% Prolog 0.57% APL 0.13%

algorithm-implementations's People

Contributors

alexmathew avatar bhupenchn avatar codymcwilliams avatar dalleng avatar davipb avatar girishramnani avatar internetsadboy avatar intoxicated avatar jakobhans avatar jcla1 avatar jonathanlebron avatar joshimoo avatar kennyledet avatar majjoha avatar mik30s avatar mitogh avatar mukeshtiwari avatar nicohinderling avatar patrickyevsukov avatar paveldedik avatar pravsingh avatar roman-kachanovsky avatar rrivera1849 avatar sjs7007 avatar tdoly avatar tylerjpond avatar upasana-me avatar wasi0013 avatar xcyborg avatar yonaba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

algorithm-implementations's Issues

Categorization/topics

Hi all,

As this repository is growing in terms of contents (so much algorithms in here), the problem of finding a needle in this haystack will certainly occur. Maybe this will be addressed in the web app (#114)... But I just feel like we should start thinking about a way of organizing all these algorithms in topics. See this project, for instance.

Cheers,
Roland.

Issue in latest merge commit messages

I think most merges and accepted PRs have wrong commit message, the message with which I'd committed. e92f741 commit is not pushed by me.
I'm not sure what did go wrong while merging.

Please update commits. It seems like recently updated every commit is Bogosort implementation.

Better organization.

I think it would be great if the algorithms are organized inside folders, group by specific topic, as follows.

  • Sorting
  • Searching

And so on.

Update on Web-App

Hey there,
I was wondering if you (@kennyledet) had an update for us regarding the
browsable web-interface for the algorithms?
Thanks, Joseph

Algorithm implementations

This is more of a feature request: would it be possible to have a way to see algorithm implementations by language? Perhaps directories of symlinks?

Thank you for the stimulating and inspiring project!

Page on the web app dedicated to the collaborators

@jcla1 , @patrickyevsukov , @dalleng

Hey, you guys have been extremely helpful and dedicated to the repo! I just want to take the time out from my schedule to thank each one of you. You're hugely contributing factors to why this repo has been successful, in addition to all the algorithm contributors.

Before eventually open-sourcing the web app (still kinda busy with work and iOS app projects, and I want the Flask codebase to be perfectly clean and ready for open source), I plan on adding a new page to it dedicated to the contributors (links to blogs/resumes, etc.).

Is this cool with you all? What would you like to see on this page?

Best regards,
Kendrick L.

Error in findEnteringColumn

I use your code, and this have issues when I run this program

Maximize p = x + y subject to 2x + y <= 4, x + 2y <= 3

I solve it changing findEnteringColumn function

`// finds the next entering column
private int findEnteringColumn(){
//float[] values = new float[cols];
//int location = 0;

    int count = 0; 
    for(int pos = 0; pos < cols-1; pos++){
        if(table[rows-1][pos] < 0){
            return pos;
            //System.out.println("negative value found");
            //count++;
        }
    }
    
    return -1; // This case never exist
    
    /*
    if(count > 1){
        for(int i = 0; i < cols-1; i++)
            values[i] = Math.abs(table[rows-1][i]);
        location = findLargestValue(values);
    } else location = count - 1;
   
    return location;
   */
}`

To validate I use this web https://www.zweigmedia.com/RealWorld/simplex.html

My complete code is here

`/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    package lp.LPObjects;

import lp.LPObjects.Simplex.ERROR;

/**

  • Use this class to test LP programs

  • @author Miguel Angel Ramos Valdovinos
    */
    public class prueba {

    public static void main(String[] args) {

     float[][] table = new float[3][6];
     
     
     table[0][0] = 2;
     table[0][1] = 1;
     table[0][2] = 1;
     table[0][3] = 0;
     table[0][4] = 0;
     table[0][5] = 4;
     
     table[1][0] = 1;
     table[1][1] = 2;
     table[1][2] = 0;
     table[1][3] = 1;
     table[1][4] = 0;
     table[1][5] = 3;
     
     table[2][0] = -1;
     table[2][1] = -1;
     table[2][2] = 0;
     table[2][3] = 0;
     table[2][4] = 1;
     table[2][5] = 0;
     
     Simplex solv = new Simplex(2, 5);
     solv.fillTable(table);
     solv.print();
     
     
     boolean cont = true;
     while (cont){
         ERROR res = solv.compute();
         if (res == ERROR.IS_OPTIMAL || res == ERROR.UNBOUNDED){
             cont = false;
         }
         solv.print();
     }
    

    }

}
`

Convex hull algorithm fails in some cases

Hi, i noticed that, in rare cases, jarvis_march fails to produce a valid hull. Instead, it keeps looping around the supplied point list. I have a really hard time understanding the problem (shouldn't be co-planarity, since it works in other cases). Anyway, i applied a patch that works for me. Not sure a PR is worth it, here my addition (which is admittedly not really mathematic-ish):

local checked = 1

while(visited[q]) do
    checked = checked + 1
    q = points[q + 1] and q + 1 or 1

    if (checked == #points) then
        return hull
    end
end

.. which goes right at line 40, before the loop. This at least prevents the algo to loop over infinitely, while still supplying a valid hull (at least, it looks to me in a test case with ~ 200 procedurally generated point clouds). I'm bothering to write here because it looks @Yonaba's Lua implementation is the landing page for people with convex-hull needs :)

LZMA

Hello,
I don't know if it is allowed but I would like to request an algorithm implementation. I've looked at your website http://algorithm.zone but I found no request form or anything like that, so I am posting here.

I'm a Lua coder looking for a pure Lua implementation of the Lempel Ziv Markov chain algorithm, but found none so far (all of them are actually implemented in C, which is useless to me since I am limited to LuaJ).

Would you please be so kind and make one? I would do that myself and make a pull request if I only had the time and especially the skill needed.

Thanks for any reply,

sincerely viluon (Andy)

Generic implementations

It'd be better to have generic implementations so these could actually be useable.
Quoting the purpose of this project:
Unfortunately, I haven't really spotted (a popular and language agnostic) one where people used the power of Git to share, discover, discuss and improve algorithm implementations!

Call for a general License

Hey guys,

since we are growing well and have many contributors, I think it's time to add a license to the repo that covers all the code in it (unless stated otherwise, maybe we should sort those out).

I would suggest MIT, but it's Kenny's repo, so he gets to decide.

Proof of Concept Site Up

Hey guys, I'm finally done with school and finals for the semester, so I've decided to put up the site for Algorithm Implementations. I've been working on it on and off for a few weeks.

The backend is done in Python/Flask with the front-end framework being Bootstrap 3. I plan to add in AngularJS for some dynamic functionality on the front-end.

It's up on Heroku for the moment:
http://dry-sea-7022.herokuapp.com/algorithms

Please let me know any suggestions/feedback you have so I can add them in before I open source it. Also going to clean the code and templates up.

Thanks,
Kendrick L.

Add .gitignore file

I was checking there are some people (including me) for some reason sometimes we send in our commit files like: compiled file or some .DS_Store file so I think it's better to add the .gitignore file with some files extension like:

  • .out
  • .DS_Store

And so on.

Site

Hey guys, just a quick update on the state of the site. School has been pretty busy lately, so I wasn't able to get anything up, but have been working on it.

I'm doing it in Python/Flask and will probably use Bootstrap/Angular for the frontend. I'm not anywhere near as proficient in Angular as I am in Python, or frontend web dev in general, so if anyone would like to help, there should be a repo up within the next week for sure this time.

Open Sourcing Web App

Hey guys. I started a new internship on Monday! Unfortunately this also means I won't have as much time to commit to updating the web app. So this weekend, I will definitely be open sourcing it here on Github.

Currently the stack is:

  • Flask (Python web framework) on the backend
  • Twitter Bootstrap on the frontend
  • SQL for the DB (using SQLAlchemy)

Algorithm Contribution Unit Test Requirement

This issue arose when I was deciding whether or not to merge #458 Please see that pull request for context, and Kenny's comments. I am opening an issue here for discussion of this topic.

Looks like all of the 99 bottles problem algorithms (with one exception) lack tests. @kennyledet, @dalleng, @jcla1, @Yonaba should tests ever be optional? If so, I can update the README to reflect that.

Folder structure

Are we still following the described folder structure?

Algorithm_Name/Language_Name/username/filename.extension

Because I don't see that happening anywhere in this project.

Merge Sort C++ Optimization

One could use the optimization made here at RosettaCode: http://rosettacode.org/wiki/Merge_sort#C.2B.2B

include

include // for std::inplace_merge

include // for std::less

template<typename RandomAccessIterator, typename Order>
void mergesort(RandomAccessIterator first, RandomAccessIterator last, Order order)
{
if (last - first > 1)
{
RandomAccessIterator middle = first + (last - first) / 2;
mergesort(first, middle, order);
mergesort(middle, last, order);
std::inplace_merge(first, middle, last, order);
}
}

template
void mergesort(RandomAccessIterator first, RandomAccessIterator last)
{
mergesort(first, last, std::less<typename std::iterator_traits::value_type>());
}

Much cleaner, and possibly more efficient.

Introduction page for algorithms

It'd be nice to have a .md for each of the algorithms that gives a brief (like one line) introduction to the kind of problems it solves, and the best and worst case. Of course one can simply hit up wikipedia, but if we're hoping to maximize accessibility, many developers might not realize they're reinventing the wheel. By having a quick note card style reference, it affords for a need-basis learning style.

Android Application Fixed

Hey guys, there was an issue with the Android app not working due to pointing to the wrong Heroku web app URL. It is fixed now!

Best regards,
Kendrick L.

Android App

Hey guys, released a native Android app for Algorithm Implementations, called Algorithms.

Here it is: https://play.google.com/store/apps/details?id=com.kennyledet.algorithms.app.grmeb

But as noted in the description, at this point it's pretty much a placeholder and a wrapper around the web app until I have more time to implement a fully native experience. It's still a bit better than viewing in a mobile browser though, and once I implement search on the web app this weekend native search will be in the app too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.