Different lengths into lexicographical order

Assignment Help Basic Computer Science
Reference no: EM132819005

1. A Young tableauis an m x n matrix such that: the entries of each row are in sorted order from left to right, and the entries of each column are in sorted order from top to bottom.

Some entries of a Young tableau may be∞, which we treat a nonexistent numbers. Give an algorithm to implement Extract-Min on a non-empty m x n Young tableau thatruns in O(m+n) time. The algorithm should use a recursive subroutine that solves an m x n problem by recursively solving either an (m-1) x nor an m x (n-1) sub-problem¬¬¬.

2. Define T(p), where p=m+n, to be the maximum running time of Extract-Min on any m x n Young tableau. Give and solve a recurrence relation for T(p) that yields the O(m+n) time bound.

3. Using no other sorting method as a subroutine, show how to use an n x n Young tableau to sort n^2 numbers in(n^3) time.

4. Show that mergesort, bubblesort, and insertion sort, if carefully done, are stablesorts. Show why quicksort and selection sort, as usually implemented, are not stable sorts.

5. Give an algorithm that, givennintegers in the range from 0 tok, preprocessesits input and then answers any query about how many of thenintegers fall into a range[a..b] inO(1) time. The algorithm should use Θ(n+k) preprocessing time

6. Consider the following problem: Sort an array of C-strings which may be of different lengths into lexicographical order. C-strings are arrays of characters where thelast character indicates the end of the string and is always the null character (Unicode orASCII 0). Lexicographical ordering is dictionary order: compare the two strings, characterby character, until the first mismatched pair of characters is found, and whichever stringhas the smaller character in that position is the smaller string. If one string is a prefix of another string, then the mismatched characters occur when at the last character of the prefix (0) and at a non-zero character of the other string, so the prefix always comes firstin lexico graphical ordering.

Consider using MSD-Radix sort to sort the strings. In practice, it is very important toswitch to insertion sort for small arrays.How many characters, on average, are examined when sortingNrandomstrings from anR-character alphabet? Hint: How many strings fall in each bucket, on average, and howmuch work is done to sort each bucket? Write and solve a recurrence relation for this.How many characters, in the worst-case, are examined, when sortingNstrings from an Rcharacter alphabet and the average string length isw?

7. Give an efficient algorithm that finds theith largest numbers in a set ofnnumbers. Do not assume that the input is sorted. The output numbers do not have to bein order. What is the running time of your algorithm?

Reference no: EM132819005

Questions Cloud

How do disclosures assist the financial statement user : Discuss why disclosures are important whenever there is a change in accounting method or estimate. How do disclosures assist the financial statement user?
What is the Zany Brainy flexible budget variance : Budgeted fixed costs totaled $400,000, while actual fixed costs amounted to $420,000. What is the Zany Brainy's flexible budget variance for total expenses
What are other possible costs of changing accounting methods : What are some other possible costs of changing accounting methods? What are the costs of implementing an accounting change?
How would you go about designing an experimental study : Describe and discuss validity and reliability. Identify the threats to experimental validity. How would you go about designing an experimental study that will.
Different lengths into lexicographical order : Consider the following problem: Sort an array of C-strings which may be of different lengths into lexicographical order.
Define how you would determine the validity and reliability : A good experimental design serves three purposes, what are those three purposes? Identify a research project that utilizes a quantitative method design.
How saint leo core value of integrity is relevant : How Saint Leo's core value of Integrity is relevant to Managerial Accounting. Describe how this fits in with the field of Managerial Accounting.
Arguments for corporate accountability and citizenship : Arguments for corporate accountability and citizenship emphasize the declining power of governments and the increasing power of multinationals
Discussion about the key variables in the selected article : Write a 750-word paper about your selected article. Be sure to include the following in your paper: A discussion about the key variables in the selected article

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd