diff --git a/BFS/WordLadder.swift b/BFS/WordLadder.swift index b4f296d..005b346 100644 --- a/BFS/WordLadder.swift +++ b/BFS/WordLadder.swift @@ -48,3 +48,45 @@ class WordLadder { return 0 } } +//c++ code of word ladder +class Solution { +public: + int ladderLength(string beginWord, string endWord, vector& wordList) { + set s; + for(int i=0;i q; + q.push(beginWord); + while(!q.empty()) + { + level++; + int siz=q.size(); + for(int i=0;i