Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Suppose there are 12 courses: C12, C16, C23, C31, C33, C34, C35, C42, C43, C45, C52, C51, which you have to take to finish your
Suppose there are 12 courses: C12, C16, C23, C31, C33, C34, C35, C42, C43, C45, C52, C51, which you have to take to finish your prestigious degree. C12 and C16 are pre-requisites for C23, C23 is prerequisite for C31, C33, C34, C35 and C33 is prerequisite for C42 and C43, C42 is prerequisite for C43, C45 is prerequisite for C52, C42 is prerequisite for C51. Model this using an appropriate data structure and explain what approach would be suitable to find the order in which these courses have to be taken. Apply the same approach and find the order. [3M]
A) In a min-heap consisting of n elements implemented as an array. What is the worst-case time taken to find the maximum element? Justify your answer.
B) We learnt binary heaps in the class. A 3-ary heap is a data structure where each node that has at most 3 children.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started