Skip to content

MayankB11/Design_Lab

Repository files navigation

Design_Lab

Autumn Semester 2019-2020
Under the supervision of Professor Abhijit Das

Holy Grail of Logology [Link]

main.cpp

  • Brute force implementation, Time complexity O(nCs*s!) where n is the total no of words in dictionary of length s
  • Trie approach (non-parallel), Time complexity O(n*26^(s-1))

p_main.cpp

  • Trie approach (parallel), Time complexity O((n*26^(s-1))/t), where t is the number of threads

Both the trie approaches have pruning.

To compile:

  • g++ p_main.cpp/main.cpp main.h -lpthread

To run: (input.txt contains no of words first and then words as input)

  • ./a.out

All constants are defined in main.h