What is the difference b/n Linear search and Binary search?
The main difference b/n Linear search and Binary search are given below:
Linear search: Linear search starts to search first records of the list and going on until it finds the matched record or to the end of list.In Linear Linked list their is no need to sort the file in a particular order.
Binary search: Their is three steps you have to follow when you using Binary search.
1.It starts with to select the middle item of the list.When the key item is less than the selected item than Binary search take the item between the current item and the start element of the list.Otherwise, if key item is greater than the selected item than Binary search take the item between the current item and the last element of the list.Benefit of its is that after taking one comparison it delete the half list.
2.If key item is less than the current item than we only take half list who is less than the key.Otherwise,If key item is greater than the current item than we only take half list who is greater than the key.And start in again.
3.We repeat step2 till we not reached our desired key. Reply
What is the Double LinkedList?
Double Linked List is that each data item in the list can point both side(next or previous)data item.
It is not specific type means it may be of stack or queue.This is use to increase the performance of program.It is also called as Two-way Linked List or
Symmetrically Linked list.Reply
What are the Linked List?
Basic definition of linked list is that An linked list is a list of data items in which each data item points to the next data item(except last item).
In linked list we start with a pointer that points to the first element of the list.after that next element points to its successor element.Last element has a NULL pointer that indicates the end of the list.
Linked are of three type:
1.Doubly linked list
2.Ordered linked list
3.Circular Linked list
We construct linked list using these functions:
LinkedList()//It is used to construct an empty list.
LinkedList(Collection<? extends E>c)//It is used to construct a list elements with specific location. Reply
What do you understand about Direct port I/O?
Direct Port I/O are of system dependent from type of computer and configuration of computer.It may be dangerous when we use this uncarefully.
Some main Direct I/O functions are given below:
inp(): Use to Inputs a byte of data from the specified port
inpw(): Use to Inputs two bytes of data from the specified port
outp(): Use to Outputs a byte of data to the specified port
outpw(): Outputs two bytes of data to the specified port
Always it returns type int,All output function returns in terms of byte or word and input function return currently input byte or word.Reply
What is the stdaux file?
First i tell you about about aux device.We can defined aux device as the main serial communication port (not the console serial communication port).
aux is defined as COM1: and stdaux writes to the COM1: port.
#include <stdlib.h> // Standard include items
#include <process.h> // For exit()
int main( // Define main() and the fact of program
int argc, // uses the passed parameters
int main(int argc,char *argv,char *envp)
for (i = 0; i < 100; i++)
/* Because stdaux is opened in the binary
mode,* CR/LF must be supplied explicitly,
�Line %2d of 100 lines�
� being written to stdaux by a program.
What are the stdin and stdout file?
We can open stdin file using operating system. Basically it touched with keyboard.It comes from an I/O redirected file.
Some functions used by stdin are given below:
getchar(): Use to get character from stdin
gets(): Use to get a string from stdin
scanf(): Use to performs a formatted read from stdin
stdout�s output goes to a redirected file.Program to use the screen by opening a file called con.
Some functions used by stdin are given below:
printf(): Use to performs a formatted write to stdout
putchar(): use to writes a character to stdout
puts(): Writes the buffer to stdout
vprintf(): Performs a formatted write to stdout. The output is pointed to by a parameter-list pointer.Reply
What are the stream files?
We can open file in C with using stream files.which are identified with a pointer to a FILE structure, or as low-level files, which are identified with an integer handle.
We ca open stream files with using one of the following functions.
fopen(): Opens the specified file with the specified mode
freopen(): Closes the file specified, then opens a new file as specified
fdopen(): Opens a duplicate stream file for an already open low-level fileReply
What are the temporary disk files?How to create them?
All most large programs with large with large data objects do not even try to save all their data
in memory.they only read the data,index the data,and than than write the file in Temporary disk files.
Some rules of creating files are given below:
1.The file name must be unique. This uniqueness can be guaranteed by using tmpfile() or tmpnam().
2.The file must be deleted when you have finished using it. If you create the file using tmpfile(), the operating system deletes the file for you. If you create it with tmpnam() and an explicit open, your program must delete the file.
Syntax of creating files are given below:
FILE *TempFile = tmpfile();
// Lines of code to use the file
What are the Text Files and Binary Files?
Text Files: Text Files are those files that are display on the screen.These files are readable files.It has not uses only few special characters like,tab and newlines.Text Files generally introduce by programmers.
Binary Files: Binary Files are those files that can contain any data, including the internal representation of numbers, special control characters.
How to differentiate local memory and global memory?
Local and global memory allocation is applicable with Intel 80x86 CPUs.
Some main difference b/n local and global variables are given below:
1.Using local memory allocation we can access the data of the default memory segment,Where as with global memory allocation we can access the default data,located outside the segment,usually in its own segment.
2.If our program is a small or medium model program , the default memory pool is local,Where as If our program uses the large or compact memory model, the default memory pool is global.Reply