Start Discovering Solved Questions and Your Course Assignments
TextBooks Included
Active Tutors
Asked Questions
Answered Questions
1 suppose you have an array ofnbspnnbspelements containing only two distinct keys true and false give anon algorithm to
1 suppose we want to partitionnbspnnbspitems intonbspgnbspequal-sized groups of sizenbspng such that the
1 write a program that readsnbspnnbsppoints in a plane and outputs any group of four or more colinear points ie points
1 suppose we choose the element in the middle position of the array as pivot does this make it unlikely that quicksort
a for the quicksort implementation in this chapter what is the running time when all keys are equalb suppose we
1 how would you implement mergesort without using recursion2 determine the running time of mergesort fora sorted inputb
1 a what is the running time of shellsort using the two-increment sequence 1 2b show that for anynbspn there exists a
1 sort the sequence 3 1 4 1 5 9 2 6 5 using insertion sort2 what is the running time of insertion sort if all elements
1 suppose we extend binomial queues to allow at most two trees of the same height per structure can we obtainnbspo1
1 a show thatnbspnnbspinserts into an initially empty binomial queue takenbspon time in the worst caseb give an
one way to delete nodes from a known position in a leftist heap is to use a lazy strategy to delete a node merely mark
suppose that binary heaps are represented using explicit links consider the prob- lem of merging binary heap lhs with
1 each deletemin operation uses 2 lognbspnnbspcomparisons in the worst caseanbsp propose a scheme so that the deletemin
1 propose an algorithm to insertnbspmnbspnodes into a binary heap onnbspnnbspelements in omnbsp lognbspnnbsplog
1 show the following regarding the maximum item in the heapa it must be at one of the leavesb there are exactly fn21
1 can both insert and find min be implemented in constant time2 a show the result of inserting 10 12 1 14 6 5 8 15 3 9
1 implement a generic map that supports the insert and lookup operations the implementation will store a hash table of
under certain assumptions the expected cost of an insertion into a hash table with secondary clustering is given by
1 a nonstandard c extension adds syntax that allows a switch statement to work with the string type instead of the
write a program to implement the following strategy for multiplying two sparse polynomials p1 p2 of size m and n
in the quadratic probing hash table suppose that instead of inserting a new item into the location suggested by findpos
1 a large number of deletions in a separate chaining hash table can cause the table to be fairly empty which wastes
1 a show that via avl single rotations any binary search treenbspt1 can be transformed into another search treenbspt2
1 anbspblowast-treenbspof ordernbspmnbspis a b-tree in which each interior node has between 2m3 and mnbspchildren
1 write a routine to list out the nodes of a binary tree in level-order list the root then nodes at depth 1 followed by