Sort by


  • BFS (breadth first search) search algorithm

    BFS or breadth first search is a very common graph searching/traversing algorithm in graph theory. It is implemented using a queue. However, a recursive version is also possible. Current implementation in java makes use of Graph and Queue classes developed previously.

    by javadream on 09 Apr 11
    0
    462 downloads
    0
  • DFS - depth first search

    DFS or depth first search is a very common graph searching/traversing algorithm in graph theory. It is implemented using a stack. However, a recursive version is also possible. Current implementation in java makes use of Graph and Stack classes developed previously.

    by javadream on 09 Apr 11
    0
    502 downloads
    0
  • LCS - Longest common substring

    LCS or longest common substring is a very interesting problem in computer science. Here, we have to find the maximum matching length (and the matching itself) between two strings. Current implementation in java makes use of DP problem solving strategy.

    by javadream on 09 Apr 11
    0
    426 downloads
    0
  • Continuous knapsack in Java

    Continuous knapsack is a famous problem in computer science to describe greedy algorithms. If a thief enters a shop to steal goods, where goods can be taken as fractions too (if needed). The thief has a maximum weight limit he can take with him. Given all the products weights and prices in the shop, you task is to help(!) the thief to maximize his profit.

    Current implementation in java uses Greedy approach to solve.

    by javadream on 09 Apr 11
    0
    438 downloads
    0
  • 0-1 Knapsack problem in Java

    0-1 knapsack is very interesting and famous problem in computer science to describe DP. Here a thief enters a shop where there are only one piece of items. The thief has a bag with him where he has a maximum weight limit to cary (we dont care about the volume of the goods, only weight). Given each items weight and price in the shop, your task is to help the thief to maximize his profit. Current implementation in java uses DP to solve this problem.

    by javadream on 09 Apr 11
    0
    662 downloads
    0
  • Dijkstra in Java

    Dijkstra's algorithm is a known graph algorithm.

    Dijkstra calculates shortest path to all the vertices starting from a single vertex. It's running time can be improved by using efficient sorting and more efficient data structure. But, for simplicity to make the implementation easy to understand for all, current implementation in java follows very simple sorting algorithm and simple data structure.

    by javadream on 09 Apr 11
    0
    586 downloads
    0
  • Kruskal's algorithm in Java

    Kruskal's algorithm is well known for finding MST or minimum spanning tree. First it sorts all the edges in non-decreasing order. Then, it keeps taking edges from the sorted list given that, at least one of the vertices at two ends of the edge is not discovered before. Current implementation uses java and pretty straight forward approach. It can be further improved by imporving sorting algorithm and using a custom Set data structure for set operations.

    by javadream on 09 Apr 11
    0
    1111 downloads
    0
  • Prim's algorithm in Java

    Prim's algorithm is used to find a minimum spanning tree. It is very similar to Kruskal's algorithm of finding shortest path in a graph. Prim's algorithm starts from a vertex and then keeps following the minimum distant edges to discover vertices, given that the vertex was not discovered before. Current implementation uses a simple and straight implementation in java. It can be further improved by improving sorting algorithm and using Min-Heap data structure for vertices. Those are not implemented to keep it simple enough to understand for all.

    by javadream on 09 Apr 11
    0
    737 downloads
    0
  • by Enas on 27 Apr 11
    0 votes
    0
  • Visual Cryptography

    Simple implementation of the visual cryptography scheme based on Moni Naor and Adi Shamir, Visual Cryptography, EUROCRYPT 1994, pp1–12. This technique allows visual information like pictures to be encrypted so that decryption can be done visually.

    The code outputs two files. Try printing them on two separate transparencies and putting them one on top of the other to see the hidden message.

    by Omri on 10 May 11
    0
    1721 downloads
    0