Question: 1 . To sort or not to sort? Design a reasonably efficient algorithm for solving each of the following problems and determine its efficiency class.
To sort or not to sort? Design a reasonably efficient algorithm for solving each of the following problems and determine its efficiency class.
a You are given in telephone bills and m checks sent to pay the bills n m Assuming that telephone numbers are written on the checks, find out who failed to pay. For simplicity, you may also assume that only one check is written for a particular bill and that it covers the bill in full.
b You have a file of n student records indicating each students number, name, home address, and date of birth. Find out the number of students from each of the US states.
Solve the following system by Gaussian elimination:
X x xx x x X x X
a Give an example of a system of two linear equations in two unknowns that has a unique solution and solve it by Gaussian elimination.
b Give an example of a system of two linear equations in two unknowns that has no solution and apply Gaussian elimination to it
c Give an example of a system of two linear equations in two unknowns that has infinitely many solutions and apply Gaussian elimination to it
For each of the following lists, construct an AVL tree by inserting their elements successively, starting with the empty tree.
a
b
c
Construct atreeforthelistC, O M P U T I, N G Use the alphabetical order of the letters and insert them successively starting with the empty tree.
a Construct a heap for the list by the bottomup algorithm.
b Construct a heap for the list by successive key insertions topdown algorithm
c Is it always true that the bottomup and topdown algorithms yield the same heap for the same input?
Sort the following lists by heapsort by using the array representation of heaps.
ain increasing order
bin increasing order
c S O R T I, N G in alphabetical order
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
