What is head data structure??

The Gateway to Computer Science Excellence

0 votes

**Merging k sorted lists of size n/k into one sorted list of n-elements using heap sort will take how much time ?**

My doubt

**First approach:-** here it is mentioned heap sort so, heap sort will always take nlogn.and here also we have n elements and it will take nlogn.

**But other method **is to use heap data structure of size k and merge,it will give **o(k)+(logk)*(n/k)**

I think answer should be nlogn only because the second approach is not heap sort.

Please check.

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,741 questions

57,245 answers

198,020 comments

104,614 users