def start_with_prefix(prefix, trie):
 branch = _retrive_branch(prefix, trie)
 if (not branch):
  return []
 prefix_list = []
 q = branch[1:]
 while q:
  curr_branch = q.pop(0)
  if _is_trie_bucket(curr_branch):
   prefix_list.append(_get_bucket_key(curr_branch))
  else:
   q.extend(curr_branch[1:])
 return prefix_list

def start_with_prefix ( prefix , trie ) : branch = _retrive_branch ( prefix , trie ) if ( not branch ) : return [ ] prefix_list = [ ] q = branch [ 1 : ] while q : curr_branch = q . pop ( 0 ) if _is_trie_bucket ( curr_branch ) : prefix_list . append ( _get_bucket_key ( curr_branch ) ) else : q . extend ( curr_branch [ 1 : ] ) return prefix_list
find words start with prefix .