LinkedList

Linked list is a data structure used for storing collection of data.Linked list have following properties:

  • Successive element are connected with pointers.
  • Last element point to null.
  • Can grow and shrink in size during program execution
  • Can be made just as long as required.
  • It does not waste memory space

Image result for linkedlist

Linked list ADT

1.Main Linked list operation

  • Insert:insert an element into the list
  • Delete:remove and return the specified position

2. Auxiliary Linked list operation

  •  Delete List:remove all element from the list
  • Count:return the number of element of the list
  • Find n position node from the end of list

Representation of Linked list in java

class LinkedList{

Node head;

class Node{

int data;

Node next;

Node(int d){

data=d;

}

}

}

 

JDBC

JDBC stands for Java Database Connectivity is standard java API(Application programming Interface a type of documents which contains all the features of a product or software. It represent class and interface for communication each other.It can be created for application,libraries,operating system etc) for connecting java program and wide range of databases  like MYSQL, ORACLE etc.

JDBC (Java Database Connectivity)

JDBC can be used in different type of executable work in java like:

1.Java Application

2.java Servlet

3.Java Server Pages

4.Enterprises javaBean

5.Java Applet

There are six simple steps to connect  database in java:

  1. Import statement: In this step we import java.sql.*; Packages containing jdbc classes.
  2. Creating Driver class: forName() method of Class. Class is used to register the driver class Syntax => Class.forName(“com.mysql.jdbc.Driver”);

3.Create a connection: The getConnection method of Driver Manager class used to establish connection with databse.

Connection conn = DriverManager.getConnection(“url”,”username”,”password”);

Connection conn=DriverManager.getConnection(“jdbc:mysql://localhost/test”,”root”,”12345″);

4.Create Statement: This is reponsible for query  execute from database

   Statement stmt=conn.createStatement(); 

5. ExecuteQuery= It returns the object of ResultSet which is responsible for get all records from        tables.

ResultSet rs=stmt.executeQuery(“select * from tables”);

6. Close the connection

conn.close();

Setting up Mysql-JDBC driver in ubuntu

Setting  up Mysql-jdbc driver involved in following steps:

  1. check updates by this command:
    sudo apt-get update
  2. install mysql and mysql secure:
  3. sudo apt-get install mysql mysql-server
    sudo mysql_secure_installation
  4. now setting classpath in Bashrc file:  by command nano ~/.bashrc
    export CLASSPATH=$CLASSPATH:/usr/share/java/mysql-connector-java.jar
  5. then write down this code/*
    Setting up Mysql-JDBC driver in ubuntu
    @author:Mitra N Mishra
    */
    import java.sql.Connection;
    import java.sql.DriverManager;
     
    class JDBCTest {
     
     private static final String url = "jdbc:mysql://localhost?useSSL=false";
     
     private static final String user = "root";
     
     private static final String password = "12345";
     
     public static void main(String args[]) {
     try {
     Connection con = DriverManager.getConnection(url, user, password);
     System.out.println("Success");
     
     } catch (Exception e) {
     e.printStackTrace();
     }
     }
    }

     

Website to learn and judge your programming languages skills!

Hello guys today i am telling you about some great websites for learning new programming languages and test your existing skills:-

1.HackerRank: HackerRank is an online community of over one million computer programmers. HackerRank’s programming challenges can be solved in a variety of programming languages (including Java, C++, PHP, Python, SQL) and span multiple computer science domains.

2.HackerEarth: HackerEarth is also online community of computer programmers HackerEarth supports over thirty two programming languages.

3.Topcoder: Topcoder has As of May 3, 2016 Topcoder has more than 997,507 registered members.

4. CodeChef : It is a global competitive programming platform which supports over 50 programming languages and has a large community of programmers that helps students and professionals test and improve their coding skills.

5. Codeforces: Codeforces is a Russianwebsite dedicated to competitive programming.

 

Searching in a single linked list with c

/*searching in linked list
@author Mitra N Mishra
*/

#include<stdio.h>
struct node
{
int value;
struct node *link;
};

void main()
{
int n;
printf(“Enter value to search\n”);
scanf(“%d”,&n);

struct node *p,n1,n2,n3,n4,n5;//for searching purpose we create a structure pointer p.and also five nodes.
struct node *start=&n1;//In linked list we only access or operation perform by the help pointer start.
n1.value=100;
n1.link=&n2;
n2.value=200;
n2.link=&n3;
n3.value=300;
n3.link=&n4;
n4.value=400;
n4.link=&n5;
n5.value=500;
n5.link=NULL;
p=start;
int pos=1;
while(p!=NULL)
{
if(p->value==n){
printf(“Item %d found at position %d\n”, n,pos);
return;
}

p=p->link;
pos++;
}
printf(“Item not found \n”);
}

Traversing a single linked list with c

#include<stdio.h>
//Basic decleration of linked list with the help of referential structure A refential structure which use structure as a references.
//linked list declerations
struct node
{
int value;
struct node *link;

};
//Main method operation performed
void main()
{
struct node *p,n1,n2,n3,n4,n5;//for traversing purpose we create a structure pointer p.and also five nodes.
struct node *start=&n1;//In linkedin we only access or operation perform by the help pointer start.

n1.value=100;
n1.link=&n2;
n2.value=200;
n2.link=&n3;
n3.value=300;
n3.link=&n4;
n4.value=400;
n4.link=&n5;
n5.value=500;
n5.link=NULL;

if(start==NULL)
{
printf(“Linked List is Empty\n”);
return;
}
p=start;
printf(“The list is\n”);
while(p!=NULL)
{
printf(“%d”, p->value);
p=p->link;
}
printf(“\n\n”);
}

Web Services

web services are open standard based web application that interact with other data in terms of exchange data, for example we make ab application then web services can convert it on web application.Web services are XML based information exchange system that uses internet for application to application interaction.

Component of web services:

1.SOAP(Simple object access protocol):-it uses for transfer message

2.UDDI(Universal description discovery and integration)

 3.WSDL(Web service description language):describe the availability of services

you can use different platform(programming) based application and access via different programming based platform due to web services.