Explain heap and queue.



Explain heap and queue...

Answer / Nitin Jeet Kumar

Heap is a data structure used to store a collection of elements with a priority, typically implemented as a binary tree. In a max-heap, the root element always has the highest priority, while in a min-heap, the root element always has the lowest priority. Queues are linear data structures that follow the FIFO (First-In-First-Out) principle, meaning that elements are removed from the front of the queue and added to the back. Queues can be implemented using arrays or linked lists.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

In which mode we open the file for read,write and append also in c ? a)W b)w+ c)r+ d)a

2 Answers   BitWise,


How do I use strcmp?

1 Answers  


Expand the following LKB BKL FFG

0 Answers  


What is type qualifiers?

1 Answers  


Compare interpreters and compilers.

1 Answers  


how can u print a message without using any library function in c

1 Answers   NIIT,


Can we declare function inside main?

1 Answers  


Explain how can a program be made to print the name of a source file where an error occurs?

1 Answers  


#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a; Printf(“%d\n”, ++*I); Printf(“%d\n”, *++I); Printf(“%d\n”, (*I)--); Printf(“%d\n”, *I); } what is the o/p a. 101,200,200,199 b. 200,201,201,100 c. 101,200,199,199 d. 200,300,200,100

1 Answers  


A.C func() { pritnf(" in fuction %d",MACRO); } MAIN.c testfunc() { #define MACRO 10 printf("in test function %d", MACRO); } main() { printf("in main %d",MACRO); func(); testfunc(); getch(); }

2 Answers   Wipro,


What is getch() function?

1 Answers  


What does double pointer mean in c?

1 Answers  


Categories