Sort by


  • Binary Tree

    Binary tree in C++

    Simple, may not be the best implementation there is. Contains functions for inserting, deleting, finding the next and previous values, checking if a node is a leaf, printing, searching, counting the number of nodes, etc.

    Also contains a main with examples. Nice for beginners.

    by cohenman on 29 May 11
    0
    536 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
    741 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
    1124 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
    587 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
    427 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
    503 downloads
    0
  • 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
    464 downloads
    0
  • Graph data structure

    Graph is a data structure used in many algorithms. It's vertices are represented by a separate class, Vertex. There is a data (Object type) field in vertex class, which can be used to store any data. Vertex class can be modified to hold any information (e.g. Student, Account, etc.) by using the example.

    by javadream on 09 Apr 11
    0
    452 downloads
    0
  • by Darian on 19 Nov 09
    0 votes
    0