CSE 310-Assignment4

CSE 310-Assignment4 -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSE310:AlgorithmsandDataStructures Assignment4:SortingandSelection DueDate:Monday,July19,2010  Question1: Whatistheminimumandmaximumnumberofelementspresentin aheapofheighth?   Question 2: Show that there are at most  nodes of height h in any n ­‑elementheap.   Question3: ProfessorSolomonclaimsthatthe  lowerboundforsorting nnumbersdoesnotapplytohismachine,inwhichthecontrolflowofaprogram cansplitthreewaysafterasinglecomparison ai:aj,accordingtowhetherai<aj, ai=aj, or ai>aj.Showthattheprofessoriswrongbyprovingthatthenumberof three ­‑waycomparisonsrequiredtosortnelementsisstill .   Question4: simple, linear time algorithm that solves the selection problem for an arbitrary orderstatistic.   Question5: ProfessorOlayisconsultingforanoilcompany,whichisplanninga largepipelinerunningeasttowestthroughanoilfieldof nwells.Fromeachwell, aspurpipelineistobeconnecteddirectlytothe mainpipelinealongashortest path (either north or south), as shown in Figure below. Given x ­‑ and y ­‑coordinatesofthewells,howshould theprofessorpicktheoptimallocationof the main pipeline (the one that minimizes the total length of the spurs)? Show thattheoptimallocationcanbedeterminedinlineartime.   ...
View Full Document

This note was uploaded on 09/03/2010 for the course CS CSE310 taught by Professor Aviralshrivastava during the Summer '10 term at ASU.

Ask a homework question - tutors are online