Answered step by step
Verified Expert Solution
Question
1 Approved Answer
https://github.com/jortizcs-rutgers/PM1-public/tree/master/lab4 the link has skeleton code and please use details for .cpp and .h files and code in C++ thanks. Solve problem 2 using binary
https://github.com/jortizcs-rutgers/PM1-public/tree/master/lab4
the link has skeleton code and please use details for .cpp and .h files and code in C++ thanks.
Solve problem 2 using binary search
Problem 1 Given a text txt[0..n-1] and a pattern pat[O..m-1], write a function search(char patD, char txtD) that prints all occurrences of pat[] in txt]. You may assume that n>m. Input: txt[] "THIS IS A TEST TEXT Output: Pattern found at index 10 Input: txt]"AABAACAADAABAABA" Output: Pattern found at index e pat] "TEST pat[-"AABA" Pattern found at index 9 Pattern found at index 12 Problem 2 Given a sorted array of String and a String x, find index of x if it is present in the array using binary search. Input : arr[] -{ "contribute", "geeks", "ide", "practice"), x- "ide" Output 2 The String x is present at index 2 Input : arr[] -"contribute", "geeks", "ide", "practice", x - "zz" output-1 The String "zz" is not presentStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started