Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
9 views
5 pages
2017 Algorithm
DU Question Papers
Uploaded by
Animesh Kumar
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save 2017_Algorithm For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
9 views
5 pages
2017 Algorithm
DU Question Papers
Uploaded by
Animesh Kumar
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save 2017_Algorithm For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 5
Search
Fullscreen
{This question psper contains 8 printed pages.) wets 8 | NOOE OIL Nee ahs teor tng naomi hgiveaiease Unigue Paper Code; 32361801... Naie'oP the Paper”: Detgs ai Kiai 6 Aortme Poa at Name of the Course ae eee No. 7. 1. @ Arrange the tolling functions in the Of nr ak FO 100 Ghai a Ny. i clement in a given aray: di [L.Se Ch) —Gnb SeCLBES) TT Saved - 20/7| 2796 2 ight md) IF 1 Is smaller than the left recursive search in the leftmost prion: iit is ewer than the right mi, pertorm a ecupve seach in the | ‘rightmost partition; else perform a recursive search in i} the middle perttion. Thus, the algérithm performs 4 | comparisons in each iteration and recurses on one-third | of te any. Write the resrence relation for he ing 1 time ofthe algorithm and ove it. o ee zr ‘le it i's cai a Ae For each possible coloring of the three nodes, ion the property tat is Violated. ® a, pero 3 ‘shopkeeper has’ W marbles and m empty bottles, Let oj, Gjnny Oy respectively denote the number of (P marbles the bottles ean contain: The shopkeeper waats to store the marbles in the bottles. ©) Describe grecdy algorithm which minimizes the ‘number of bottles used. (@ How would you modify your algorihan i bottle | ‘also has an cesoviated cost price pj and the ‘onli to minimize the total coet of the bottles sed. Gr) istibuted. Then: (i) will the sort stil S_ sive.comect output? (i) what will be the impact of telaxing this condition on the runaing time ? Justify @ Discuss the run time complenity of the naive string “atohing algorithm, o {8) Compare the space requirements of adjacency list and djacncy matrix ropreseitatins of praph having m © edges and a vertices. ® (© Give a efficent algorithm to fad the minimym element Ju 4 maxcheap, Give the exact runing time of the cy seri, ® Pro.2796 4 He op a7 TS of te ces sch bre) ‘Rte a weldied gph wth etary ce srg? ty your aes, ® 12. (@) Give on efficient algorithm to check if given undirected ‘sah has a cycle, Discuss the time complexity of your algorithm. 3 () For each of the following operations does 2 Red Black ‘Tree work faster than Binary Search Tree? Elaborate © Search iy ontondee avers o 3. (@)A priority queue is implemented in two different ways toring = max heap a ing ‘order of ke} values (higher key value indicates higher priority). Compare the time complexity ofthe following an array sorted in de operations when performed on the two different implementations of the priority queue (@ Finding the maximom element (i) Deleting the maximum element (Gy Taorease the pririty of a certain elenieat (6) 5 (©) Suppose «graph has two edge-Sisjoit spanning trees (wo spanning trees that have #0 edges in common). ‘Argue that inthis graph G, every pair of nodes forms part of s cycle, o (@) Consider the following recursive algorithm to find an optimal schedule for weighted interval scheduling problem: ‘Compute_optt) Ij = 0 then “Retura 0 Blse : Rerum many + Comypse_ opt), Compue op) (© Explain why does his algorithm take exponential time to ran in the wort case () What changes should be made to the above ‘Algorithm fo make t run in polynomial time, o (©) Suppose that an nx n array A consist of 1’s and O's such that in any row of all the 1's come before any 0's in that row. Give an O(algn) algorithm for counting ouAhe umber of U's in A, o Pro.©. (@) Which red-back tree properties may be violated when a 2796 6 +s 2 5. (@) Give an example graph having four nodes that docs @D hhave a topological ordering ® Hicst. The instructor wishes to sort the m integer scores (0 Suppose a lve aay i msntained withthe following 1 policy: the sts inal sre, When ew elements te ded, they we loved tthe oni of he ny tn conse. Witt the ber of pow mens cher ee es 10, the array is resorted and the counter is cleared. ee CONT coutiet a ee, Whe taf ev Ginko es eng Sei cet 00) se th Hien ner tt en Tae ie irs te hihet order bt. Th ely operation on the comer is “nsreneat (©) We use Randomized-Select to select the minimum clement of the array A=<3,2,9,0, 75. Describe « sequence of partitions thet would result in the worst ‘cate performance of the algorithm, o ie sort algorithm is such that depts the worst cate beh the running time ofthe merge sor gorithm nstance, ® ge weights are allowed to be ‘your answer with an argument, o fers and on Integer T. It finds iether there exist two elements in the array that sm up to T and returss 1 on success and 0 onihe 20 SES, ae
You might also like
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Mark Manson
4/5 (6453)
Principles: Life and Work
From Everand
Principles: Life and Work
Ray Dalio
4/5 (643)
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Brené Brown
4/5 (1175)
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
Chris Voss
4.5/5 (1004)
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Jeannette Walls
4.5/5 (1856)
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Angela Duckworth
4/5 (650)
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
Jesmyn Ward
4/5 (1267)
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Stephen Chbosky
4.5/5 (4102)
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Phil Knight
4.5/5 (628)
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
Margot Lee Shetterly
4/5 (1022)
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Ben Horowitz
4.5/5 (361)
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
Ashlee Vance
4.5/5 (581)
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
Siddhartha Mukherjee
4.5/5 (298)
Steve Jobs
From Everand
Steve Jobs
Walter Isaacson
4.5/5 (1139)
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
Frank McCourt
4.5/5 (943)
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
Sarah M. Broom
4/5 (100)
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
Gilbert King
4.5/5 (280)
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Thomas L. Friedman
3.5/5 (2289)
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
Garth Stein
4/5 (4372)
Yes Please
From Everand
Yes Please
Amy Poehler
4/5 (2016)
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
Roxane Gay
4/5 (1090)
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
Betty Smith
4.5/5 (2033)
The Outsider: A Novel
From Everand
The Outsider: A Novel
Stephen King
4/5 (2884)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Dave Eggers
3.5/5 (233)
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Doris Kearns Goodwin
4.5/5 (244)
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Naomi Klein
4/5 (78)
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Jay Sekulow
3.5/5 (144)
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
Jennifer Egan
3.5/5 (919)
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Bob Woodward
3.5/5 (836)
John Adams
From Everand
John Adams
David McCullough
4.5/5 (2546)
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
George Packer
4/5 (45)
Little Women
From Everand
Little Women
Louisa May Alcott
4.5/5 (2369)
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel
John le Carré
4/5 (278)