Skip to content

rentiandong/WordGraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Overview

This program determines how closely words are related in a graph by measuring path length from one word to another. An edge is established between words if one can be transformed into another by exactly one substitution, deletion, addition, or sbustitution in either word.

Assumptions

No special characters such as "@" or "(" in a word

Usage

Constructor of WordGraph takes a List object which has all the words to be considered. A WordGraph instance has several member methods.

  • int numberOfComponents(): returns the number of connected components in the WordGraph instance as an integer
  • List shortestPath(String word1, String word2): returns the words on the path from word1 to word2 in the WordGraph instance. An empty list is returned if such path does not exist.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages