Question

In: Computer Science

Quick Revision of basic ideas about strings – 695-701. Do this via strategic questions of the...

Quick Revision of basic ideas about strings – 695-701.

Do this via strategic questions of the students

Use set 5.1 StringSorts slides 1-16.

Again if the lecturer has a computer in the lectern, it would be helpful to go through some of the code snippets throughout this lecture.

Go through 51DemoKeyIndexed Counting slides 1-19 – preferably by having the students act it out as before in conjunction with slides 17-21 of 5.1 StringSorts.

Try to cover at least LSD and MSD sorts and 3-way radix sort. Slides 22-57 of 5.1 StringSorts.

Could skip section on suffix arrays slides 58-73 of 5.1 StringSorts.

Slides 74-89 are missing.

Discuss Slide 90

Homework Exercises

  1. Why are StringSorts stable?
  2. Why are StringSorts efficient compared with other types of sorts?
  3. Are there times when StringSorts are not efficient? If yes, when and why does this occur?
  4. If the answer to 3 is yes, what, if anything, can be done to make the sort more efficient?

Solutions

Expert Solution

1. There are basically two methods of string filtering.
i) .LSD --- This method checks the letters of the keys in the right-to-left sequence. This filter is used when all buttons are equal in length

ii). MSD - This method scans the letters for the left and right sequences, working with the most important character first.

By using (LSD and MSD) String sort algorithm, we maintain a consistent order of records with equal keys. That equal objects retain their relative position after filtering. We can therefore say that the types of cables are stable in data structure and algorithms.

2. complexity

as you can see the space and time complexity of string sort is very less as compared to other sorts . so the speed of the sort will be more. Biggest advantage of string sort is its speed because it is branch-free algorithm. It makes string sort fastest possible sort algorithm for relatively short fixed length keys. The stability of string sort  is also nice feature.

It can handle strings of variable length. It doesn't always need to scan the entire strings (it can decide sooner about the order ). One can use insertion sort to avoid the disadvantages of counting sort.

3. The string type slows down when the word size is large, such as when there is a large key range but a small radix. The reason that large radix can be used all the time is because it becomes a color calculator, with a large memory associated with it. string -radix  sorting is more specialized. You need a specific key that's in lexicographic order. You need one bucket for each possible symbol in the key, and the buckets need to hold a lot of records.

Thank YOu !!


Related Solutions

Think about the following questions, and post your ideas or questions to the discussion forum. How...
Think about the following questions, and post your ideas or questions to the discussion forum. How many siblings do you have? (You may make up a realistic number if you wish to keep your family information private.) Which do you think is larger, the mean number of siblings of people in this class, or the median number of siblings? Why do you think so? How would you verify your answer to #2? What questions would you need to ask? Why...
Read the questions carefully and do not look for a quick answer. There are none. Your...
Read the questions carefully and do not look for a quick answer. There are none. Your answers should reflect your ability to think about complexity using multiple disciplines to explore murky answers. Your answers must be typed, and it should be more than 4 citations. Please explain in 3-4 full paragraph and please add the site that you used. It should be more than 4 sources. 1)How will space exploration and travel be changed with the private sector playing a...
What is evolutionary psychology? What basic ideas about human development are proposed by evolutionary psychologist? What...
What is evolutionary psychology? What basic ideas about human development are proposed by evolutionary psychologist? What is bonding? How is it linked to child out come? What changes Characte puberty?
How do ideas about "normal" and "abnormal" human behavior influence the experience of the individual? Taking...
How do ideas about "normal" and "abnormal" human behavior influence the experience of the individual? Taking this a step further, how does the concept of normal vs abnormal become a form of oppression?
How do you go about generating initial ideas for pieces you’re composing, as well as the...
How do you go about generating initial ideas for pieces you’re composing, as well as the details and explanation needed to develop and support main ideas?
Cognitive creativity How do they compare to Csikszentmihalyi’s ideas? Begin by brainstorming about your curiosity and...
Cognitive creativity How do they compare to Csikszentmihalyi’s ideas? Begin by brainstorming about your curiosity and interest exploration. Go with the flow of your thoughts, and do not censor yourself.
What do the liquidity ratios – Current, Quick, and Cash-to-Sales – reveal about JCP’s financial position?...
What do the liquidity ratios – Current, Quick, and Cash-to-Sales – reveal about JCP’s financial position? Given that: Liquidity ratios – Current, Quick, and Cash-to-Sales --- Current Ratio: Current Assets/Current Liabilities- 2012: 3,683/2,568= 1.43 2011: 5,081/2,756= 1.84 2010: 6,370/2,647= 2.40 Quick Ratio: (Current Assets-Inventory)/Current Liability 2012: (3,683-2,341)/2,548= 0.52 2011: (5,081-2,916)/2,756= 0.78 2010: (6,370-3,213)/2,647= 1.19 Cash To Sales Ratio: Cash balance at the end of the period/Sales 2012: 930/12,985= 0.05 2011: 1,507/17,260= 0.08 2010: 2,622/17,759= 0.14
Balance the following redox reaction in basic solution then answer these questions about the balanced reaction....
Balance the following redox reaction in basic solution then answer these questions about the balanced reaction. Cl2(g) → Cl-(aq) + ClO-(aq) Part 1: What is the stoichiometric coefficient in front of Cl2 in the balanced reaction? Part 2: What is the stoichiometric coefficient in front of OH- in the balanced reaction? Part 3: What is the stoichiometric coefficient in front of Cl- in the balanced reaction? Part 4: What is the stoichiometric coefficient in front of OCl- in the balanced...
Correction to earlier question: Via the Born Oppenheimer Approximation, How do you go about solving for...
Correction to earlier question: Via the Born Oppenheimer Approximation, How do you go about solving for the wave function of H2+ and H2, once you've constructed the electronic schrodinger eq?
How do communicators assure they are being precise and clear about ideas being communicated? Although audiences...
How do communicators assure they are being precise and clear about ideas being communicated? Although audiences might be content with ambiguous, vague or equivocating business communications, why is the sender of the communication responsible and accountable for fashioning a clear and meaningful message that anyone can properly interpret? How does inaccurate and imprecise business communication confuse or discourage the audience in making a decision? Why should proper nouns be used rather than pronouns in formal business writing? How can the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT