Skip to main content

Linked list data structure

Linked list is technic to store data in memory it's provide efficiency way to store data
In not contiguous memory allocation.
So user can access data from the memory and implement easily data into the memory.
  So the user can access the data insertion ,deletion , updation  in easy manner .
  There are three of linked list 
  Types of linked list 
  Single linked list
  Doubly linked list
  
  Circular linked list :
  
 Single linked list have only linked address of data the user can store the data from this address into the memory.
The syntax will be like this:

 Struct node {
           Int data;
         Struct node *next;
         }
         
Doubly linked list :

Doubly linked have double pointer address 
First address denotes to the previous data of address . 
and next pointer denote to the data address itself.
 The syntax of the  will be linke this :
 
 Struct node{
   Struct node *previous pointer ;
       Int data ;
       Struct node *next pointer ;
       }
Circular linked list :
The circular linked list first Pointing address have the last data pointer address .
I mean that address is denoting to first data this will  end of data next address .

For example we can write syntax like this :

 Struct node {
 
        Struct node *previous pointer address;
        int data ;
        Struct node *next pointer address;
        
        }
So I hope understood structure definition of linked list one by one.

Popular posts from this blog

What is algorithm and uses in real life ?

The algorithm is a method to analyze a program step by step. In the process, analysis can  be a finite number of steps called algorithms. The algorithm is a set of well-defined computational procedures it takes some input numbers and gives desired output to the user. "set of procedures" called an algorithm. Sometimes algorithms are incorrect and correct  Because algorithms are made by humans it depends on human logic how they mad algorithms. solving problem algorithms can be different from it  depends on the user and how the user makes an algorithm to solve the problem because solving methods can be different. That algorithm that takes less time to solve problems is called the "efficient " algorithm. Let's understand how we use salve problem: Example 3. Find the greatest between 2 numbers. Step 1: Start Step 2: Take 2 numbers as input, say A, B. Step 3: Check if(A>B) Step 4: Then A is greater Step 5: Print A Step 6: Else Step 7: Check if(B>A ) Step 8: Then...

Block Scope Variable in Java

A block scope refers to variables that are declared within a pair of curly braces {}, such as within methods, loops, or conditionals Demonstration of block scope variable:    int x; // known to all code withing block global declaration   if(x==10) {   // start new scope  int y=20; / / y known only to this block // x and y both here can be used   System.out.println("x and y" + x and "" +y);   x=y*2; } // y =100/ Error! you can't call y here because out of scope here // x  is still known here  System.out.println("x is "+x);                        } }|                          

Type cast variable in java

    Type casting is the process of converting a variable from one data type to another. This is especially useful when you're working with different numeric types or when dealing with inheritance in object-oriented programming. There are two main types of type casting in Java: 1. Widening Casting (Implicit): This happens automatically when converting a smaller type to a larger type size: int myInt = 9; double myDouble = myInt; 2. Narrowing Casting (Explicit): This must be done manually when converting a larger type to a smaller type: java : double myDouble = 9.78; int myInt = (int) myDouble; 3.Type casting also applies to objects in inheritance hierarchies: java : Animal a = new Dog();  // Upcasting (automatic) Dog d = (Dog) a;   class Test{  public static void main(String args[]){ byte b;  int i=257; double d=323.142; System.out.println("In conversion of byte . ");  b=(byte)i; System.out.println("convertion of double to int. "); i=(int)d; Sy...