SlideShare a Scribd company logo
1 of 16
Souvenir’s Booth
USING AUTO COMPLETE
By: Abhinav Garg (101303004) | Akshit Arora (101303012) | Chahak Gupta (101303041)
(Analysis and Design of Algorithms (UCS 501) Project)
Submitted To - Ms. Tarunpreet Bhatia
“ANY”
“XYZ”
Project Introduction
• Autocomplete, is a feature in which an application predicts the rest
of a word a user is typing. In graphical user interfaces, users can
press the tab key to accept a suggestion or the down arrow key to
accept one of several.
• It speeds up human-computer interactions when it correctly predicts
words being typed. It works best in domains with a limited number
of possible words.
• The project focuses on studying different approaches to generate
strings with the prefix entered by the user.
Objective
1. To optimize auto-completion of the word.
2. To optimize depth first search by improving the traversal of data
structure by special algorithm and analysis techniques.
3. To search word in trie.
4. Modify the default structure of trie and with certain tweaks
improve the overall time complexity.
5. We substantially increased the number of word in the Trie from 4
to 45000 words and it worked correctly.
Algorithm Techniques Used
1. For printing all possible words in a trie with given root:
Backtracking Traversal (similar to DFS)
2. For searching the prefix in trie: naïve algorithm used
3. For insertion of new words in trie: Recursion
Structure of Node used in the project
Pseudocode -1 (Trie, C++)
suggest(key, pos, * root){
if(root->ptrs[key[pos]] != NULL){
suggest(key,pos+1,root->ptrs[key[pos]])
else
printall(root)
SOUVENIR_BOOTH(file, key, len)
string word
node *root
open file("wordlist.txt")
while(end of file)
word<-getword_from_file
insertword(word,0,root)
close file
if(len<=0)
return -1
suggest(key,0,root)
if(found)
print “no words found”
return
Pseudocode – 1 (Trie, C++)
InsertWord(word,pos,*root) {
If word.length()=pos
root->Word <- word
return
if root-> ptrs[word[pos]] IS NULL
newnode <- new node
newnode->info <- word[pos]
root->ptrs[word[pos]] <- newnode
insertword(word,pos+1,root->ptrs[word[pos]])
else
insertword(word,pos+1,root->ptrs[word[pos]])
printall(* root){
for i<-0 to 255
if(root->ptrs[i]!=NULL){
printall (root->ptrs[i])
if(root->Word != "" AND (root->Word.length() = len AND
len!=-9999))
print root->Word
else if(root->Word != "" AND len = -9999)
Print root->Word
found <- 1
Results and Screenshots
Figure 1: Output when user doesn't know length Figure 2: Output when user inputs non-positive length
Figure 3: Output when
specified length matches
Results and Screenshots
Figure 4: The dictionary
Asymptotic Analysis (Space complexity)
In worst case analysis, the dictionary will consist of words with no
common prefix. At every level, 256 combinations will be possible
from each node. So this will result in a lot of memory usage.
Maximum number of nodes possible at level 1=256;
Maximum number of nodes possible at level 2=2562 …
Maximum number of nodes possible at level m=256m
Maximum total number of nodes in a trie with m as maximum length
of word will be:
256+2562+2563+2564+……………. 256m
= (256(256m+1 – 1) )/( 256-1)
= (256/255) (256m+1 – 1) = O(256m)
Asymptotic Analysis (Time Complexity)
1. The key determines trie’s depth.
2. Using trie, we can search / insert the single key in O(M) time.
Here, M is maximum string length.
3. In this project, we get the search result in O(key_length + ∑(L)),
where key_length is input given by user and ∑(L) is summation of
all the string lengths starting with prefix entered by user.
Conclusions
1. Souvenir’s Booth problem of finding the desired solution was
solved.
2. Auto complete was successfully implemented using Trie.
3. Suggests words if words of desired length are not available.
4. DFS and Trie's implementation was understood.
Achievements
Autocomplete speeds up human-computer interactions when it correctly predicts words being typed.
It works best in domains with a limited number of possible words (such as in command line
interpreters), when some words are much more common (such as when addressing an e-mail), or
writing structured and predictable text (as in source code editors).
Can be used for:
1. Web browsers: filling similar fields
2. E-mail programs: auto fill email
3. Search engines: Based on search history
4. Word Processors: auto correct
5. IDEs: syntax correction and highlighting
6. Mobiles: Typing most commonly used words
References
Topcoder Tutorials: https://www.topcoder.com/community/data-
science/data-science-tutorials/using-tries/
Bhavin’s Blog (Directi): http://bhavin.directi.com/to-trie-or-not-to-
trie-a-comparison-of-efficient-data-structures/
Wikipedia – Autocomplete and Trie data structure articles
Geeks for Geeks: http://www.geeksforgeeks.org/trie-insert-and-
search/

More Related Content

What's hot

What's hot (20)

Algorithms Lecture 3: Analysis of Algorithms II
Algorithms Lecture 3: Analysis of Algorithms IIAlgorithms Lecture 3: Analysis of Algorithms II
Algorithms Lecture 3: Analysis of Algorithms II
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Data Structures- Part5 recursion
Data Structures- Part5 recursionData Structures- Part5 recursion
Data Structures- Part5 recursion
 
Pumping lemma for regular set h1
Pumping lemma for regular set h1Pumping lemma for regular set h1
Pumping lemma for regular set h1
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction Problem
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
 
6-Python-Recursion PPT.pptx
6-Python-Recursion PPT.pptx6-Python-Recursion PPT.pptx
6-Python-Recursion PPT.pptx
 
Longest Common Subsequence
Longest Common SubsequenceLongest Common Subsequence
Longest Common Subsequence
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithm
 
Python tuples and Dictionary
Python   tuples and DictionaryPython   tuples and Dictionary
Python tuples and Dictionary
 
Huffman coding
Huffman coding Huffman coding
Huffman coding
 
Hash table
Hash tableHash table
Hash table
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesPython - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning Libraries
 
First Order Logic resolution
First Order Logic resolutionFirst Order Logic resolution
First Order Logic resolution
 
Hashing
HashingHashing
Hashing
 
Hash table
Hash tableHash table
Hash table
 
TOC 5 | Regular Expressions
TOC 5 | Regular ExpressionsTOC 5 | Regular Expressions
TOC 5 | Regular Expressions
 
02 Fundamental Concepts of ANN
02 Fundamental Concepts of ANN02 Fundamental Concepts of ANN
02 Fundamental Concepts of ANN
 

Similar to Souvenir's Booth - Algorithm Design and Analysis Project Presentation

An Efficient Search Engine for Searching Desired File
An Efficient Search Engine for Searching Desired FileAn Efficient Search Engine for Searching Desired File
An Efficient Search Engine for Searching Desired FileIDES Editor
 
Searching Keyword-lacking Files based on Latent Interfile Relationships
Searching Keyword-lacking Files based on Latent Interfile RelationshipsSearching Keyword-lacking Files based on Latent Interfile Relationships
Searching Keyword-lacking Files based on Latent Interfile RelationshipsTakashi Kobayashi
 
Automatic document clustering
Automatic document clusteringAutomatic document clustering
Automatic document clusteringIAEME Publication
 
Text classification with fast text elena_meetup_milano_27_june
Text classification with fast text elena_meetup_milano_27_juneText classification with fast text elena_meetup_milano_27_june
Text classification with fast text elena_meetup_milano_27_juneDeep Learning Italia
 
Multi Document Text Summarization using Backpropagation Network
Multi Document Text Summarization using Backpropagation NetworkMulti Document Text Summarization using Backpropagation Network
Multi Document Text Summarization using Backpropagation NetworkIRJET Journal
 
IRE- Algorithm Name Detection in Research Papers
IRE- Algorithm Name Detection in Research PapersIRE- Algorithm Name Detection in Research Papers
IRE- Algorithm Name Detection in Research PapersSriTeja Allaparthi
 
Article Summarizer
Article SummarizerArticle Summarizer
Article SummarizerJose Katab
 
Algorithm Name Detection & Extraction
Algorithm Name Detection & ExtractionAlgorithm Name Detection & Extraction
Algorithm Name Detection & ExtractionDeeksha thakur
 
Sk t academy lecture note
Sk t academy lecture noteSk t academy lecture note
Sk t academy lecture noteSusang Kim
 
The Ring programming language version 1.5.3 book - Part 187 of 194
The Ring programming language version 1.5.3 book - Part 187 of 194The Ring programming language version 1.5.3 book - Part 187 of 194
The Ring programming language version 1.5.3 book - Part 187 of 194Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 100 of 212
The Ring programming language version 1.10 book - Part 100 of 212The Ring programming language version 1.10 book - Part 100 of 212
The Ring programming language version 1.10 book - Part 100 of 212Mahmoud Samir Fayed
 
A template based algorithm for automatic summarization and dialogue managemen...
A template based algorithm for automatic summarization and dialogue managemen...A template based algorithm for automatic summarization and dialogue managemen...
A template based algorithm for automatic summarization and dialogue managemen...eSAT Journals
 
Automation Testing theory notes.pptx
Automation Testing theory notes.pptxAutomation Testing theory notes.pptx
Automation Testing theory notes.pptxNileshBorkar12
 
Dictionary implementation using TRIE
Dictionary implementation using TRIEDictionary implementation using TRIE
Dictionary implementation using TRIECharmi Chokshi
 
The Ring programming language version 1.6 book - Part 182 of 189
The Ring programming language version 1.6 book - Part 182 of 189The Ring programming language version 1.6 book - Part 182 of 189
The Ring programming language version 1.6 book - Part 182 of 189Mahmoud Samir Fayed
 
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...Simplilearn
 
A Dialogue System for Telugu, a Resource-Poor Language
A Dialogue System for Telugu, a Resource-Poor LanguageA Dialogue System for Telugu, a Resource-Poor Language
A Dialogue System for Telugu, a Resource-Poor LanguageSravanthi Mullapudi
 
6.domain extraction from research papers
6.domain extraction from research papers6.domain extraction from research papers
6.domain extraction from research papersEditorJST
 

Similar to Souvenir's Booth - Algorithm Design and Analysis Project Presentation (20)

An Efficient Search Engine for Searching Desired File
An Efficient Search Engine for Searching Desired FileAn Efficient Search Engine for Searching Desired File
An Efficient Search Engine for Searching Desired File
 
Searching Keyword-lacking Files based on Latent Interfile Relationships
Searching Keyword-lacking Files based on Latent Interfile RelationshipsSearching Keyword-lacking Files based on Latent Interfile Relationships
Searching Keyword-lacking Files based on Latent Interfile Relationships
 
Automatic document clustering
Automatic document clusteringAutomatic document clustering
Automatic document clustering
 
Text classification with fast text elena_meetup_milano_27_june
Text classification with fast text elena_meetup_milano_27_juneText classification with fast text elena_meetup_milano_27_june
Text classification with fast text elena_meetup_milano_27_june
 
Multi Document Text Summarization using Backpropagation Network
Multi Document Text Summarization using Backpropagation NetworkMulti Document Text Summarization using Backpropagation Network
Multi Document Text Summarization using Backpropagation Network
 
Google code search
Google code searchGoogle code search
Google code search
 
IRE- Algorithm Name Detection in Research Papers
IRE- Algorithm Name Detection in Research PapersIRE- Algorithm Name Detection in Research Papers
IRE- Algorithm Name Detection in Research Papers
 
Article Summarizer
Article SummarizerArticle Summarizer
Article Summarizer
 
Algorithm Name Detection & Extraction
Algorithm Name Detection & ExtractionAlgorithm Name Detection & Extraction
Algorithm Name Detection & Extraction
 
Sk t academy lecture note
Sk t academy lecture noteSk t academy lecture note
Sk t academy lecture note
 
The Ring programming language version 1.5.3 book - Part 187 of 194
The Ring programming language version 1.5.3 book - Part 187 of 194The Ring programming language version 1.5.3 book - Part 187 of 194
The Ring programming language version 1.5.3 book - Part 187 of 194
 
The Ring programming language version 1.10 book - Part 100 of 212
The Ring programming language version 1.10 book - Part 100 of 212The Ring programming language version 1.10 book - Part 100 of 212
The Ring programming language version 1.10 book - Part 100 of 212
 
A template based algorithm for automatic summarization and dialogue managemen...
A template based algorithm for automatic summarization and dialogue managemen...A template based algorithm for automatic summarization and dialogue managemen...
A template based algorithm for automatic summarization and dialogue managemen...
 
Automation Testing theory notes.pptx
Automation Testing theory notes.pptxAutomation Testing theory notes.pptx
Automation Testing theory notes.pptx
 
Dictionary implementation using TRIE
Dictionary implementation using TRIEDictionary implementation using TRIE
Dictionary implementation using TRIE
 
The Ring programming language version 1.6 book - Part 182 of 189
The Ring programming language version 1.6 book - Part 182 of 189The Ring programming language version 1.6 book - Part 182 of 189
The Ring programming language version 1.6 book - Part 182 of 189
 
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
 
A Dialogue System for Telugu, a Resource-Poor Language
A Dialogue System for Telugu, a Resource-Poor LanguageA Dialogue System for Telugu, a Resource-Poor Language
A Dialogue System for Telugu, a Resource-Poor Language
 
CPPDS Slide.pdf
CPPDS Slide.pdfCPPDS Slide.pdf
CPPDS Slide.pdf
 
6.domain extraction from research papers
6.domain extraction from research papers6.domain extraction from research papers
6.domain extraction from research papers
 

More from Akshit Arora

Kalam innovation award
Kalam innovation awardKalam innovation award
Kalam innovation awardAkshit Arora
 
Capstone Report - Industrial Attachment Program (IAP) Evaluation Portal
Capstone Report - Industrial Attachment Program (IAP) Evaluation PortalCapstone Report - Industrial Attachment Program (IAP) Evaluation Portal
Capstone Report - Industrial Attachment Program (IAP) Evaluation PortalAkshit Arora
 
Organizational behavior presentation - Origins of Intelligence
Organizational behavior presentation - Origins of IntelligenceOrganizational behavior presentation - Origins of Intelligence
Organizational behavior presentation - Origins of IntelligenceAkshit Arora
 
Application of Management Tools: Total Quality Management Course
Application of Management Tools: Total Quality Management CourseApplication of Management Tools: Total Quality Management Course
Application of Management Tools: Total Quality Management CourseAkshit Arora
 
A multilevel automatic thresholding method based on a genetic algorithm for a...
A multilevel automatic thresholding method based on a genetic algorithm for a...A multilevel automatic thresholding method based on a genetic algorithm for a...
A multilevel automatic thresholding method based on a genetic algorithm for a...Akshit Arora
 
Industrial Attachment Program (IAP) Report
Industrial Attachment Program (IAP) ReportIndustrial Attachment Program (IAP) Report
Industrial Attachment Program (IAP) ReportAkshit Arora
 
G.D.P. Trends in India
G.D.P. Trends in IndiaG.D.P. Trends in India
G.D.P. Trends in IndiaAkshit Arora
 
SRS for Ph.D. Student Portal (C.S.E.D., Thapar University)
SRS for Ph.D. Student Portal (C.S.E.D., Thapar University)SRS for Ph.D. Student Portal (C.S.E.D., Thapar University)
SRS for Ph.D. Student Portal (C.S.E.D., Thapar University)Akshit Arora
 
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPT
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPTImage Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPT
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPTAkshit Arora
 
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project R...
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project R...Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project R...
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project R...Akshit Arora
 
Developing Interactive Landslide Simulator
Developing Interactive Landslide SimulatorDeveloping Interactive Landslide Simulator
Developing Interactive Landslide SimulatorAkshit Arora
 
Developing Interactive Landslide Simulator (Poster)
Developing Interactive Landslide Simulator (Poster)Developing Interactive Landslide Simulator (Poster)
Developing Interactive Landslide Simulator (Poster)Akshit Arora
 
Developing Interactive Landslide Simulator (Report)
Developing Interactive Landslide Simulator (Report)Developing Interactive Landslide Simulator (Report)
Developing Interactive Landslide Simulator (Report)Akshit Arora
 
Emotional Regulation and Stress Burnout
Emotional Regulation and Stress BurnoutEmotional Regulation and Stress Burnout
Emotional Regulation and Stress BurnoutAkshit Arora
 
Asynchronous processors Poster
Asynchronous processors PosterAsynchronous processors Poster
Asynchronous processors PosterAkshit Arora
 
Asynchronous Processors - The Clock less Future
Asynchronous Processors - The Clock less FutureAsynchronous Processors - The Clock less Future
Asynchronous Processors - The Clock less FutureAkshit Arora
 

More from Akshit Arora (17)

Kalam innovation award
Kalam innovation awardKalam innovation award
Kalam innovation award
 
Cv akshitarora
Cv akshitaroraCv akshitarora
Cv akshitarora
 
Capstone Report - Industrial Attachment Program (IAP) Evaluation Portal
Capstone Report - Industrial Attachment Program (IAP) Evaluation PortalCapstone Report - Industrial Attachment Program (IAP) Evaluation Portal
Capstone Report - Industrial Attachment Program (IAP) Evaluation Portal
 
Organizational behavior presentation - Origins of Intelligence
Organizational behavior presentation - Origins of IntelligenceOrganizational behavior presentation - Origins of Intelligence
Organizational behavior presentation - Origins of Intelligence
 
Application of Management Tools: Total Quality Management Course
Application of Management Tools: Total Quality Management CourseApplication of Management Tools: Total Quality Management Course
Application of Management Tools: Total Quality Management Course
 
A multilevel automatic thresholding method based on a genetic algorithm for a...
A multilevel automatic thresholding method based on a genetic algorithm for a...A multilevel automatic thresholding method based on a genetic algorithm for a...
A multilevel automatic thresholding method based on a genetic algorithm for a...
 
Industrial Attachment Program (IAP) Report
Industrial Attachment Program (IAP) ReportIndustrial Attachment Program (IAP) Report
Industrial Attachment Program (IAP) Report
 
G.D.P. Trends in India
G.D.P. Trends in IndiaG.D.P. Trends in India
G.D.P. Trends in India
 
SRS for Ph.D. Student Portal (C.S.E.D., Thapar University)
SRS for Ph.D. Student Portal (C.S.E.D., Thapar University)SRS for Ph.D. Student Portal (C.S.E.D., Thapar University)
SRS for Ph.D. Student Portal (C.S.E.D., Thapar University)
 
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPT
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPTImage Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPT
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPT
 
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project R...
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project R...Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project R...
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project R...
 
Developing Interactive Landslide Simulator
Developing Interactive Landslide SimulatorDeveloping Interactive Landslide Simulator
Developing Interactive Landslide Simulator
 
Developing Interactive Landslide Simulator (Poster)
Developing Interactive Landslide Simulator (Poster)Developing Interactive Landslide Simulator (Poster)
Developing Interactive Landslide Simulator (Poster)
 
Developing Interactive Landslide Simulator (Report)
Developing Interactive Landslide Simulator (Report)Developing Interactive Landslide Simulator (Report)
Developing Interactive Landslide Simulator (Report)
 
Emotional Regulation and Stress Burnout
Emotional Regulation and Stress BurnoutEmotional Regulation and Stress Burnout
Emotional Regulation and Stress Burnout
 
Asynchronous processors Poster
Asynchronous processors PosterAsynchronous processors Poster
Asynchronous processors Poster
 
Asynchronous Processors - The Clock less Future
Asynchronous Processors - The Clock less FutureAsynchronous Processors - The Clock less Future
Asynchronous Processors - The Clock less Future
 

Recently uploaded

VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 

Recently uploaded (20)

VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 

Souvenir's Booth - Algorithm Design and Analysis Project Presentation

  • 1. Souvenir’s Booth USING AUTO COMPLETE By: Abhinav Garg (101303004) | Akshit Arora (101303012) | Chahak Gupta (101303041) (Analysis and Design of Algorithms (UCS 501) Project) Submitted To - Ms. Tarunpreet Bhatia
  • 3. Project Introduction • Autocomplete, is a feature in which an application predicts the rest of a word a user is typing. In graphical user interfaces, users can press the tab key to accept a suggestion or the down arrow key to accept one of several. • It speeds up human-computer interactions when it correctly predicts words being typed. It works best in domains with a limited number of possible words. • The project focuses on studying different approaches to generate strings with the prefix entered by the user.
  • 4. Objective 1. To optimize auto-completion of the word. 2. To optimize depth first search by improving the traversal of data structure by special algorithm and analysis techniques. 3. To search word in trie. 4. Modify the default structure of trie and with certain tweaks improve the overall time complexity. 5. We substantially increased the number of word in the Trie from 4 to 45000 words and it worked correctly.
  • 5. Algorithm Techniques Used 1. For printing all possible words in a trie with given root: Backtracking Traversal (similar to DFS) 2. For searching the prefix in trie: naïve algorithm used 3. For insertion of new words in trie: Recursion
  • 6. Structure of Node used in the project
  • 7. Pseudocode -1 (Trie, C++) suggest(key, pos, * root){ if(root->ptrs[key[pos]] != NULL){ suggest(key,pos+1,root->ptrs[key[pos]]) else printall(root) SOUVENIR_BOOTH(file, key, len) string word node *root open file("wordlist.txt") while(end of file) word<-getword_from_file insertword(word,0,root) close file if(len<=0) return -1 suggest(key,0,root) if(found) print “no words found” return
  • 8. Pseudocode – 1 (Trie, C++) InsertWord(word,pos,*root) { If word.length()=pos root->Word <- word return if root-> ptrs[word[pos]] IS NULL newnode <- new node newnode->info <- word[pos] root->ptrs[word[pos]] <- newnode insertword(word,pos+1,root->ptrs[word[pos]]) else insertword(word,pos+1,root->ptrs[word[pos]]) printall(* root){ for i<-0 to 255 if(root->ptrs[i]!=NULL){ printall (root->ptrs[i]) if(root->Word != "" AND (root->Word.length() = len AND len!=-9999)) print root->Word else if(root->Word != "" AND len = -9999) Print root->Word found <- 1
  • 9. Results and Screenshots Figure 1: Output when user doesn't know length Figure 2: Output when user inputs non-positive length Figure 3: Output when specified length matches
  • 10. Results and Screenshots Figure 4: The dictionary
  • 11. Asymptotic Analysis (Space complexity) In worst case analysis, the dictionary will consist of words with no common prefix. At every level, 256 combinations will be possible from each node. So this will result in a lot of memory usage. Maximum number of nodes possible at level 1=256; Maximum number of nodes possible at level 2=2562 … Maximum number of nodes possible at level m=256m Maximum total number of nodes in a trie with m as maximum length of word will be: 256+2562+2563+2564+……………. 256m = (256(256m+1 – 1) )/( 256-1) = (256/255) (256m+1 – 1) = O(256m)
  • 12. Asymptotic Analysis (Time Complexity) 1. The key determines trie’s depth. 2. Using trie, we can search / insert the single key in O(M) time. Here, M is maximum string length. 3. In this project, we get the search result in O(key_length + ∑(L)), where key_length is input given by user and ∑(L) is summation of all the string lengths starting with prefix entered by user.
  • 13.
  • 14. Conclusions 1. Souvenir’s Booth problem of finding the desired solution was solved. 2. Auto complete was successfully implemented using Trie. 3. Suggests words if words of desired length are not available. 4. DFS and Trie's implementation was understood.
  • 15. Achievements Autocomplete speeds up human-computer interactions when it correctly predicts words being typed. It works best in domains with a limited number of possible words (such as in command line interpreters), when some words are much more common (such as when addressing an e-mail), or writing structured and predictable text (as in source code editors). Can be used for: 1. Web browsers: filling similar fields 2. E-mail programs: auto fill email 3. Search engines: Based on search history 4. Word Processors: auto correct 5. IDEs: syntax correction and highlighting 6. Mobiles: Typing most commonly used words
  • 16. References Topcoder Tutorials: https://www.topcoder.com/community/data- science/data-science-tutorials/using-tries/ Bhavin’s Blog (Directi): http://bhavin.directi.com/to-trie-or-not-to- trie-a-comparison-of-efficient-data-structures/ Wikipedia – Autocomplete and Trie data structure articles Geeks for Geeks: http://www.geeksforgeeks.org/trie-insert-and- search/