"Programming is an art form that
fights back"
Data Structures Interview Questions - Page 15
What is the output of the following program?
#include<stdio.h>
int main()
{
int i=10,j=20;
j=i++ + ++i;
printf("%d %d",i,j);
return 0;
}
Ans: As per C standard, there is no such rule to
evaluate either right or left hand side of operator + on priority.Hence
the statements like i+++++i should be avoided in programming
What are the major data structures used in the
following areas: Network data model, Hierarchical data model, and
RDBMS? The major data structures used in the above areas are:
Network data model – Graph
Hierarchical data model – Trees
RDBMS – Array
Comparing to Incomplete Binary Tree, Complete Binary Tree and Full Binary
Tree, Which tree is efficient considering space and time complexities?
Full binary tree loses its nature when operation as of insertions and
deletions are done. For Incomplete Binary trees extra storage is
required and overhead of NULL node checking takes place. So complete
binary tree is the better one since the property of complete binary tree
is maintained even after operations like additions and deletions are
done on it.
What can we do using Data Structures?
Data structure allows:
• Group related items together
• Organize them in memory so that its convenient to program and
efficient to execute
Example
• An array is one kind of data structure (basically collection of
Integers
What are malloc,calloc and free?
malloc and free provide a simple general-purpose memory allocation
package. malloc returns a pointer to a block of at least size bytes
beginning on a word boundary.
The argument to free is
a pointer to a block previously allocated by malloc; this space is made
available for further allocation, but its contents are left undisturbed.
What is an empty
string?
A string with zero character is called an empty string.
What is 'burst time' in operating system (OS) | cpu
scheduling algorithms
Burst Time is actually time that is required to
complete execution of particular task or process.
CPU Scheduling algorithms require Burst time as
input.
Different CPU Scheduling algorithms are :
a) FCFS.
b) SJF.
c) PRIORITY.
d) ROUND ROBIN.
What is use terminating null character?
Null character is used to check the end of string.
What is Brute Force algorithm?
Algorithm used to search the contents by comparing each element of array
is called Brute Force algorithm
What are the properties of an algorithm?
An
algorithm must possess the following properties:
a. It should get input data.
b. It should produce output.
c. The algorithm should terminate.
d. Algorithm should be clear to understand.
e. It should be easy to perform.
|
|