Viva Questions
Viva Questions
Viva Questions
get() does not extract the delimeter The this pointer is an object pointer
newline character from input stream. On which points to the currently calling object,
the other hand getline() does extract the The this pointer is, by default, available to
delimeter newline character from the input each called member function.
stream so that the stream is empty after Full form of LIFO is LAST IN FIRST
getline() is over. OUT. An example of LIFO list is stack.
Stack is a linear data structure in which
The ios::out is the default mode of insertion and deletion of elements takes
ofstream. With the mode of the file does place only one end known as TOP. Stacks
not exist, it gets created but if the file are used
exists then its existing contents get • For converting postfix expression
deleted. The ios::app is output mode of into infix expression & for
ofstream. With the mode of the file does evaluation of postfix expressions
not exist, it gets created but if the file • In function calls, arguments are
exists then its existing contents are stored on stacks
retained and new information is appended
to it. Full form of FIFO is FIRST IN FIRST
OUT. An example of FIFO list is Queue.
Pointer is an address of a memory Queue is a linear data structure in which
location. A variable, which holds an address insertion and deletion of elements takes
of a memory location, is known as a Pointer place from two opposite ends rear and
variable (or Simply Pointer). For example front respectively.Queues are used
int *P; in Printers as a queue of printing jobs
Some arithmetic operators can be used in operating system as queue of processes
with pointers:Increment and decrement
operators ++, -- Two types of searches are there : Linear
Integers can be added to or subtracted search & Binary Search.
from pointers using the operators +, -, +=, Precondition for Binary search to be
and -= performed on a single dimensional array is
Each time a pointer is incremented by 1, it array should be sorted.
points to the memory location of the next Sorting : Arranging data either in
element of its base type. ascending or descending order is known as
If "p" is a character pointer then "p++" will sorting.
increment "p" by 1 byte. Types of sorting : Selection, Insertion &
If "p" were an integer pointer its value on Bubble
"p++" would be incremented by 2 bytes.