Skip to main content

What is a linked list and why linked list?


What is a linked list?
     A linked list is a linear data structure used to organize the data in the memory. As its name indicates linked list is a list of items called the 'NODE' linked using  pointers. A 'NODE' is a structure of List containing  two or more fields called the 'data /Info' field and 'Link/address' field. A linked list can be of any of the following type. Linked list used for collecting a sequence of objects, which allows efficient addition, removal and retrieval of elements from any position in the sequence. It is implemented as nodes, each of which contains a reference (i.e., a link) to the next and/or previous node in the sequence.
bulletSingly-Linked ListsbulletDoubly-Linked Lists or Two way Linked ListbulletCircularly-Linked ListsbulletCircularly-Doubly Linked Lists






Fig: Simple Linked List.



Why Linked lists?
            Let us consider an example of implementation of a STACK or a QUEUE using a linear array then it is necessary to declare the SIZE of the STACK or QUEUE array (at Compile time) this may leads to either memory wastage or insufficient memory. This is the main disadvantage of a linear array. So if we use a linked list, we can allocate the  memory "Dynamically"   ( ie. during Run time). So there will not be any problem of memory wastage or insufficient memory.
           Whenever we want to insert or delete an element from a linear array either we must overwrite the value or we should shift the elements to new location. Where as in a linked list we can directly insert or delete the elements without effecting the other elements. So we need Linked List. 



Comments

  1. Thanks for your informative article. Java is most popular programming language used for creating rich enterprise, desktop and web applications. Keep on updating your blog with such informative post. Java Course in Chennai | Best JAVA Training in Chennai

    ReplyDelete

  2. As I am fresher I have an interest in new technology.so,now I am planning to learn new technology in a blog, here i had some interesting concepts, it was crystal clear to read keep sharing thanks
    Regards,
    sas course in Chennai|sas training institutes in Chennai|sas training in Chennai

    ReplyDelete
  3. Hi
    Quite Interesting post!!! Thanks for posting such a useful post of linked list. I wish to read your upcoming blog to enhance my skill set in java, keep blogging.
    Regards,
    SAP training in chennai|SAP course in chennai

    ReplyDelete
  4. Helo
    I really enjoyed while reading your article, the information you have mentioned in this post was damn good. Keep sharing your blog with updated and useful information.
    Regards,
    SAP MM Training In Chennai|sap training in Chennai|sap course in Chennai|SAP Training in Chennai

    ReplyDelete
  5. This comment has been removed by a blog administrator.

    ReplyDelete
  6. Thank you so much for this info. It is really useful. java training in chennai

    ReplyDelete
  7. Hello! This is my first visit to When I initially commented, I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get several your blog!
    safety course in chennai

    ReplyDelete
  8. Sap Training Course in Delhi, Noida and Gurgaon with 100% Live Project. High Technologies Solutions is a One Of the Leading Institute in Delhi, India for Sap Course/Classes/Center/Institute with Global Certified Center. Call Now & Get Free Demo Classes-+91-9311002620.
    best institute for sap course in Delhi
    best institute for sap course in Noida
    best institute for sap course in Gurgaon

    ReplyDelete
  9. nice blog, I like your good post, thanks for sharing great information.
    Web Designing Training in Noida

    ReplyDelete
  10. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    Java Training in Chennai | J2EE Training in Chennai | Advanced Java Training in Chennai | Core Java Training in Chennai | Java Training institute in Chennai

    ReplyDelete

Post a Comment

Give your valuable Comment...

Popular posts from this blog

Object-Oriented Programming and JAVA Programming Language

  Object-Oriented Programming and:   Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, messaging, modularity, olymorphism, and inheritance. Many modern programming languages now support OOP, at least as an option. JAVA Programming Language: Object-oriented programming is at the core of Java. In fact, all Java programs are object-oriented, this isn’t an option the way that it is in C++, for example. OOP is so integral to Java that you must understand its basic principles before you can write even simple Java programs. Therefore, this chapter begins with a discussion of the theoretical aspects of OOP.

Read or input form user in Java using BufferedReader

 BufferedReader use to read text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines.The buffer size may be specified, or the default size may be used. The default is large enough for most purposes. In Java  BufferedReader is a efficient method to read an input. Here given a short example to read a string from user and print it: package palindrome; import java.io.BufferedReader; import java.io.InputStreamReader; public class  inputExample   {     public static void main(String[] args) throws Exception {    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));     String s = new String();       s =br.readLine();     System.out.println(s);     } }

Absolute value and Floating-point absolute value function in C Programming Language

Absolute value function in C Programming Language is abs(i), Its return the absolute valu of i. where  i  is any positive or negative  number. It is integer type function. The include file of abs(i) is stslib.h Observe under program: #include<stdio.h> #include<stdlib.h> int main(void) { int a; scanf("%d",&a); printf("%d",abs(a)); } Here I use a integer number. Input it by scanf and print the Absolute value by abs() function. Floating-point Absolute value function in C Programming Language is fabs(i), Its return the absolute valu of i. where  i  is any positive or negative  Floating-point number. It is double integer type function. The include file of fabs(i) is math.h Observe under program: #include<stdio.h> #include<stdlib.h>  int main(void) { float a; scanf("%f",&a); printf("%.2f",fabs(a)); } Here I use a integer number. Input it by scanf and print the Floating-point Absolute value b