KyaPoocha.com

Huge Collection of Interview Questions


‘Data Structure Interview Questions’ - KyaPoocha.com

hat member function places a new node at the end of the linked list? 

appendNode() will place a node at the end of the linked list. addNode() may take two parameters, node to be inserted and position and add the element at the specified... Read more »

A node can reference more than one data element. 

Yes, a node itself can contain as many data elements as it needs and it can also reference other data elements. Following is an example of a complex node strcuture... Read more »

Link list does not have any advantage when compared to an Array. 

False: When you dont know in advance how many elements will be there linked list is more suitable than array.  Read more »

Link list does not have any advantage when compared to an Array. 

Explanation: A linked list can grow and shrink in size dynamically at runtime, whereas an array is set to a fixed size at compile time. False: When you dont know... Read more »

____________ Memory is Volatile. 

RAM is volatile. Because, at the time of system is ON the Ram has data and the system is in OFF state, it has no data i.e. it is free. It won’t reside any... Read more »

What is a linked list? 

Linked list is a data structure which contains data elements and a pointer of the node type which points to the next node in the linked list. It is useful when you... Read more »

Each entry in a linked list is called a _______. 

Explanation: Each entry in a linked list is called a node. Think of a node as an entry that has three subentries. One subentry contains the data, which may be one... Read more »

How is the front of the queue calculated ? 

The front of the queue is calculated by front = (front+1) % size  Read more »

What is the formula used to calculate the back of the queue? 

The back of the queue is calculated by using the following formula:back = (back+1) % size  Read more »

Why is the isEmpty() member method called? 

IsEmpty() is called to decide whether the queue has at least one element. This method is called by the dequeue() method before returning the front element.  Read more »

What is the relationship between a queue and its underlying array? 

A queue’s elements may be stored in an array. Two indexes, front and end will be used to identify the start and end of the queue. When an element is removed... Read more »

What is the difference between declaration and definition? 

DECLARATION : declaration only creates the variable name and nothing exists against it. i.e no memory space is consumed. eg. extern a; DEFINITION : definition declares... Read more »

What is the use of fflush() function? 

Suppose we read a sentence using scanf e.g. “My name is ABC” in a string. Printing this string using a printf statement prints “My”. Go for... Read more »

Without using /,% and * operators. write a function to divide a number by 3? 

#include #include void main() { int i,n; float j=0; clrscr(); printf(”enter the no”); scanf(”%d”,&n); for(i=n;i>2;i=i-3) { j=j+1; if(i==4) { j=j+1.333333; } if(i==5) { j=j+1.666666; } } printf(”%f”,j); getch(); }  Read more »

What does it mean when a data structure is declared volatile? What does it mean when a data structure is declared Const? 

Volatile - you are asking compiler to not to optimise the data structure as well as to reload to CPU registers whenever it is in use. Not a good idea for Data structure,... Read more »

Page 4 of 8« First...«23456»...Last »