Adding IP address in Oracle Linux can be done by editing the network-scripts. While this procedure is tested on Oracle Linux, i'm sure it should work on Redhat Enterprise Linux and other versions of Redhat . Editing network - scripts The network interface configuration files are found in the directory: /etc/sysconfig/network-scripts/ To add an IP address to an interface eth0 # cd /etc/sysconfig/network-scripts/ # vi ifcfg-eth0 Enter the below parameters for static configuration DEVICE="eth0" BOOTPROTO="static" BROADCAST="192.168.2.255" HWADDR="00:0C:29:DS:22:26" IPADDR="192.168.2.2" NETMASK="255.255.255.0" NETWORK="192.168.2.0" ONBOOT="yes" TYPE="Ethernet" Save the file by typing ESC :wq R estart the network service for the changes to take effect. # service network restart
/*c program to find out factorial value of a number*/ #include < stdio.h > #include < conio.h > int main() { int n,i,factorial=1; printf("Enter any number : "); scanf("%d", & n); for(i=1; i<=n; i++) factorial = factorial * i; printf("Factorial value of %d = %d",n,factorial); return 0 ; }
Quick sort is a divide and conquer algorithm. Its divided large list in mainly three parts: 1. Elements less than pivot element. 2. Pivot element. 3. Elements greater than pivot element. Where pivot as middle element of large list. Let’s understand through example: List : 3 7 8 5 2 1 9 5 4 In above list assume 4 is pivot element so rewrite list as: 3 1 2 4 5 8 9 5 7 Here, I want to say that we set the pivot element ( 4 ) which has in left side elements are less than and right hand side elements are greater than. Now you think, how’s arrange the less than and greater than elements? Be patient, you get answer soon. Now let’s start understand the concept of quick sort. The steps are : 1. Pick a pivot element. 2. Reorder the list so that all elements with values less than the...
Comments
Post a Comment