Write algorithm to reverse a singly linked list.
write algorithmto reverse a singly link list
What is the difference b/n run time binding and compile time binding?
When the address of functions are determined a run time than it is called run time or dynamic binding or late binding.While when the address of functions are determined a compile time than it is called compile time or static binding or early binding.
What is the difference b/n a linker and linkage?
The key difference b/n linker and linkage is that linker is used to change an object code into an executable code by linking together the necessary build in functions.Place where we declare the variable in a program is called the linkage of variable.
Why n++ executes faster than n+1?
n++ executes faster than n+1 because n++ want only one instruction for execution where n+1 want more one instruction for execution. Reply
What is a pragma?
# pragma preprocessor directive is use to allow the compiler to do the some specific operation of compiler.pragma has on and off command using them we can enable or disable some compiler operations.
Suppose, In our program loop does not perform his operation may be it happen because of pragma.
1.If we want to enable the operation of loop using pragma. Than we have to write like that,
2.If we want to disable the operation of loop using pragma. Than we have to write like that,
What do you understand about B-Tree?
When we uses B-Tree. Each data object has a key, all the key who are less than the given are placed on left side where as key who are greater than the given key are placed on the right side. Using this method key maintain a tree like structure for the given list of item.Some, Important terms that we generally used in B-Tree are given below:
Node: Indicates the data items 0f the list in B-Tree.
Root node: Indicates the first node in B-Tree.
Left side: Which data items on the left side and less than the current item.
Right side: Which data items on the Right side and greater than the current item.
balance: This is use to check the tree is balance or not.
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