Homework

# For LogicPro only Implement the pattern-matching algorithm…

Customer Question
For LogicPro onlyImplement the pattern-matching...
For LogicPro onlyImplement the pattern-matching algorithm shown in the pseudo-code listing below. The 'slist' object in the pseudo-code is a map data structure. Most listings of this algorithm's use arrays, however, a map is much more space efficient.Your map data structure is your dynamic-array, converted to a map that takes pairs as data members. Also, the map is implemented as a hash-table. The midterm contained a hash-table section that handled unique-string combinations. For this map, design your hashing function to handle 'unique strings' of length 1 thru 8.This algorithm expects unique strings of length 1 (the lower ascii table). Test your implementation using a range of text strings and patterns. For testing purposes, assume the strings are unique and you do not need to check for uniqueness.A second test would be to test unique strings of length > 1. Note that a unique string is a string that contains unique characters not present in other strings. For example: , , are unique strings of length 3, while ,, are not unique.See algorithms below for pseudo-code. Also, the uploaded sample code for Rabin-Karp (RabinKarp.cpp), has a bug in the implementation: sometimes it finds a match, and sometimes it doesn't. It should always find it, as it's a character-by-character crawler. Part 2 of this assignment is to fix bug, so it finds it in all cases.Algorithm Position(c, s, t)
1 for o = len(t)+1 to 1 dec o
2 f = true
3 for i = 0 to len(s) step i
4 it = o - len(s) - 1 + i
5 if it >= 0 and s[i] != t[it]
6 f = false
7 it = o - len(s) - 1
8 if f == true and (it<=0 or t[it-1] ne c)
9 return len(t) - o + 1
1 for x = 0 to len(p)-1 step 1
2 slist[p[x]] = len(p) - x - 1Algorithm GoodShift(k)
1 b = ""
2 for i = 0 to len(k) step 1
3 slist[len(b)] = Position(k[len(k) - 1 - i],b,k)
4 b = k[len(k) - 1 - i] + b
5 return slistAlgorithm Search(t,p)
1 g = GoodShift(p)
3 while i < len(t) - len(p) + 1
4 j = len(p)
5 while j > 0 && p[j-1] == t[i+j-1]
6 j -= 1
7 if j > 0
8 bs = b[t[i+j-1]]
9 gs = g[len(p)-j]
10 if bs > gs
11 i += bs
12 else
13 i += gs
14 else
15 return i
16 return -1Algorithm Test()
1 target = "block of text ..."
2 pattern = "some pattern"
3 Search(target,pattern)
Submitted: 1 month ago.Category: Homework
Show More
Show Less
3/16/2018
Tutor: LogicPro, Engineer replied 1 month ago
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13,422
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML
Verified

Hi,

Welcome

Thank you for asking me. Hope you are doing well.

Category: Homework
Satisfied Customers: 3,040
3,040 Satisfied Customers
Experience: MIT Graduate (Math, Programming, Science, and Music)

Scott is online now

A new question is answered every 9 seconds

• Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
• Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

## What Customers are Saying:

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here.

DianeDallas, TX

< Previous | Next >

## Meet the Experts:

LogicPro

Engineer

13,422 satisfied customers

Expert in Java C++ C C# VB Javascript Design SQL HTML

Manal Elkhoshkhany

Tutor

4,551 satisfied customers

More than 5000 online tutoring sessions.

Linda_us

Finance, Accounts & Homework Tutor

3,138 satisfied customers

Post Graduate Diploma in Management (MBA)

Chris M.

M.S.W. Social Work

2,636 satisfied customers

Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)

F. Naz

Chartered Accountant

2,161 satisfied customers

Experience with chartered accountancy

Bizhelp

CPA

1,887 satisfied customers

Bachelors Degree and CPA with Accounting work experience

Seanna

Tutor

1,781 satisfied customers

3,000+ satisfied customers, all topics, A+ work

< Previous | Next >

Related Homework Questions
The bank will be minute based. Each customer will be added
The bank will be minute based. Each customer will be added to the queue at a random interval from 1 to 4 minutes. Run the simulation for 480 minutes. Use the following Algorithm: . 1) Choose a random … read more
Raj
SAP ABAP Consultant
Master\u0027s Degree
27 satisfied customers
Seem to be stuck in Adapted Mind at Level 28 of 4th grade
Seem to be stuck in Adapted Mind at Level 28 of 4th grade math. Can you help with that? … read more
GLENN
Master of Mathematics
390 satisfied customers
can you please help me with the following Countries with a socialist background have been moving toward the decentralization of healthcare delivery thereby allowing more of a private sector. … read more
lani_s
Bachelor\u0027s Degree
47 satisfied customers
C++ can also gve me the algoritm Part I: Create three
c++ can also gve me the algoritmPart I:Create three arrays: (Be sure to do this first) You can put the data into a file (extra credit) or hard code it in main. The data is as follows:NAMES GRADES AGES… read more
LogicPro
Engineer
13,422 satisfied customers
Drawings that depict existing conditions are often marked
Drawings that depict existing conditions are often marked with A. blue lines indicating future expansion plans. B. the term "graphic FACP required." C. the term "as-built." D. a symbols legend.… read more
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
Exam Results Technology Orientation, Part 1 Exam Number
Exam ResultsTechnology Orientation, Part 1 Exam Number 062005RR Grade 65 Date Graded 04/15/18 Question Number Your Answer Answer Reference 1. C Correct 2. C D PAGE 42 3. D C PAGE 66 4. C A PAGE 10 5. … read more
Chris M.
M.S.W. Social Work
Master's Degree
2,636 satisfied customers
I very new to programming. I am working on a uni assignment.
I very new to programming. I am working on a uni assignment. And I stuck on one part of my code. I have been trying to fix it for 4 hours, and I cant figure it out … read more
Ingo U
Master\u0027s Degree
509 satisfied customers
Glenn, Attached you can see the new assignment. Due in three
Hi Glenn, Attached you can see the new assignment. Due in three days. Let me know if it is clear… read more
GLENN
Master of Mathematics
390 satisfied customers
I have a javascript assignment that I am having
good evening I have a javascript assignment that I am having complications understanding what she is requesting for us to do … read more
LogicPro
Engineer
13,422 satisfied customers
Trying to come up with 3 sociological concepts in the movie
trying to come up with 3 sociological concepts in the movie This is 40 and example of each from movie … read more
GLENN
Master of Mathematics
390 satisfied customers
Looking for Microeconimics help. K. Mo
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
1. Why does Pumblechook choke on the brandy at Christmas
1. Why does Pumblechook choke on the brandy at Christmas dinner? A. He becomes overexcited telling his story. B. Mrs. Joe had only spoiled brandy to serve him. C. He has had too much to drink. D. Pip … read more
Chris M.
M.S.W. Social Work
Master's Degree
2,636 satisfied customers
Case Study 1: Keylogger Scam Read the article titled:
Case Study 1: Keylogger ScamRead the article titled: “Police Foil \$420 Million Keylogger Scam” found on the eWeek.com Website located at http://www.eweek.com/c/a/Security/Police-Foil-420-Million-Keylo… read more
GLENN
Master of Mathematics
390 satisfied customers
This question is about MRI's and their usefulness. If a
Hi. This question is about MRI's and their usefulness. If a neuroanatomist gets the anatomy wrong about a specific white matter tract of the brain, let's use the superior occipitofrontal fasciculus as… read more
Dr. Mark
M.D. in Neurosurgery
Doctoral Degree
11,974 satisfied customers
I need it in c++ It is in the link
https://fgamedia.org/faculty/anand/cs2c/labs/2C.Lab-02-Spec-SparseMats.pdfhttps://fgamedia.org/faculty/anand/cs2c/modules/cs_2C_2b_7.html I need it in c++ … read more
LogicPro
Engineer
13,422 satisfied customers
You did an awesome job last time, decided to come back. The
Hey LogicPro, you did an awesome job last time, decided to come back. The assignments is due Saturday, thanks… read more
LogicPro
Engineer
13,422 satisfied customers
C Programming Language Write a main function that include
C Programming Language Write a main function that include these operations:a) ask for an integer and output whether the entered number is ***** or net. b) ask for two floats and outputs the largest of… read more
Ingo U
Master\u0027s Degree
509 satisfied customers
I need help with my math project. Let me copy and past the