Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Let S be a set of n keys being mapped to a hash table (also) of size n. Find the expected number of

1. Let S be a set of n keys being mapped to a hash table (also) of size n. Find the expected number of empty

1. Let S be a set of n keys being mapped to a hash table (also) of size n. Find the expected number of empty slots under uniform hashing assumption. 2. Let S be a set of n keys being mapped to a has table of size n under chaining. Let X denote the length of longest chain in any slot. Show that the expected value E[X] = O(logn). 3. A string is palindromic if it is equal to its reverse. e.g.,abcabacba. Given a string T[1..n], find the largest palindromic suffix of this string in O(n) time. 4. Let T[1..n] be the text drawn from alphabet set E. Now, given i we want to find the lexi- cographic rank of suffix T[i..n] among all the suffixes of T. Give an O(n) algorithm for this task which does not involve building a suffix array or suffix tree. 5. Let T[1..n] be the text drawn from alphabet E. Our task is to construct an LCP array. LCP stands for longest common prefix. LCP array aids SA (suffix array) in doing faster binary search. LCP array is defined as LCP[i] = length of the longest common prefix of T[SA[i]..n] and T[SA[i+1]...n]. For example, for acacaac#, SA = = [8,5,6,3, 1, 7, 4, 2] and LCP = [0, 1,2,3,0, 1,2]. Given a suffix tree show an algorithm which can compute LCP in O(n) time. Assume that the suffix tree has edge labels which are in terms of two integers: starting and ending locations of the substring in T. Clearly describe what fields you would maintain in the "Node" structure and give a precise pseudocode based on tree traversal. Note that this is an implementation-level question so you must give a pseudocode. Just a high level description is not sufficient.

Step by Step Solution

3.41 Rating (157 Votes )

There are 3 Steps involved in it

Step: 1

Solutions Step 1 The expected number of empty slots in a hash table with n keys and n slots under uniform hashing assumption can be calculated as follows Let pi be the probability that the ith slot re... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Algorithms

Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest

3rd edition

978-0262033848

More Books

Students also viewed these Programming questions

Question

What is regret ? (p. 2 49)

Answered: 1 week ago

Question

Active listening includes silent pauses

Answered: 1 week ago