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.

Compilation Process of a C++ Program

Compiling a C++ program involves a number of steps (most of which are transparent to the user): · First, the C++ preprocessor goes over the program text and carries out theinstructions specified by the preprocessor directives (e.g., #include ). The result is a modified program text which no longer contains any directives. · Then, the C++ compiler translates the program code. The compiler may be a true C++ compiler which generates native (assembly or machine) code, or just a translator which translates the code into C. In the latter case, the resulting C code is then passed through a C compiler to produce native object code. In either case, the outcome may be incomplete due to the program referring to library routines which are not defined as a part of the program. For example, Listing 1.1 refers to the << operator which is actually defined in a separate IO library. · Finally, the linker completes the object code by linking it with the object code of any lib...

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);     } }