Introduction To Single Linked List

Description 

  • In a single-linked list every element contains some data and a link to the next element(link), which allows to keep the structure.
  • In this type of Linked List two successive nodes are linked together in linear fashion.
  • Each element of the list is called a "node".
  • First node is called "head" and it's a dedicated node. By knowing it, we can access every other node in the list. 
  • Last node of the list is called "Tail",By knowing it we can perform add operation.
  • Each Node contain address of the next node to be followed.
  • In Single Linked List only Linear or Forward Sequential  movement(traversal) is possible.
  • Elements are accessed sequentially, no direct access is allowed.

Structure of single linked list

  • Every node of a singly-linked list contains following information
    • A value (primitive data/user define data).
    • A link to the next element (pointer data).
  • Sketchy, it can be shown like this...







    Example 1:   primitive data type single lined list
                                 struct single_link_list
                                   {

                                            int data;

                                            struct slink*next;

                                    };

    Example 2:   User define data type single lined list

                                  struct emp
                                    {
                                             int id;
                                             char name[36];
                                             int sal;
                                     };
                                     struct single_link_list
                                      {
                                            struct emp data;
                                            struct slink*next;
                                      };

    Single linked list Internal representation


    • In Singly-linked list implementation First node called head and no other node points to it. 
    • Link to the head is usually stored its data and information of next data structure(Next link). For empty list, head initial value is set to "NULL".
    • in Single linked list Last node called "Tail" usually stored its data and Next link data value is set to "NULL" because it is terminal node.
    • Below you can see another picture, which shows the whole singly-linked list internal representation..
      Operations on Single Linked List
      • Adding node
      • Inserting  node
      • node Count
      • Traversal
      • Deletion node
      • Updating node data 

      Difference Between Array and Linked List

      Array Vs Linked List

      • Array and linked list are having 4 main difference....
            1. Element Access
            2. Memory Structure
            3. Insertion / Deletion
            4. Memory Allocation

      Element Access

      • Stack elements can be randomly Accessed using Subscript e.g array[0],array[1] can be randomly accessed.
      • While In Linked List We have to Traverse Through the Linked List for Accessing Element. So O(n) Time required for Accessing Element.
      • Generally In linked List Elements are accessed Sequentially.
      Memory Structure
      • Stack is stored in contiguous Memory Locations.
      • Element is stored at any available Location , but the Pointer to that memory location is stored in Previous Node. 
      Insertion / Deletion
      • As the Array elements are stored in Consecutive memory Locations so insertion and deletion is allowed.
      • In Linked List we have to Just Change the Pointer address field ,So Insertion and Deletion Operations are quite easy to implement.
      Memory Allocation
      • Memory Should be allocated at Compile-Time in Stack.
      • In Linked list memory can be allocated at Run-Time.
      • Stack uses Static Memory Allocation.
      • Linked List Uses Dynamic Memory Allocation

      Cygwin installation on windows Operating system with NetBeans IDE integration

      Description

      • Cygwin is a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows.
      • A DLL (cygwin1.dll) which provides substantial POSIX API functionality.
      • The Cygwin DLL currently works with all recent, commercially released x86 32 bit and 64 bit versions of Windows, starting with Windows XP SP3.
      • This we are using this compiler we can Get that Linux feeling - on Windows.

      Linked List Introduction

      Introduction

      • In memory a linked list is a data structure that consists of a sequence of data records in a such way that each record there is a field that contains a pointer to the next record in the sequence.
      • Each record of a linked list is often called an element or node.
      • Each element of the list contains the address of the next node is usually called the next link or next pointer and remaining fields are known as data, or information, or value, or cargo,or payload fields.
      • The first node/element of the list is called 'Head' or Car and last node is called 'Tail' or CDR (pronounced could-er).
      • Linked list are classified into three types of linked list
            1. Single linked list
            2. Double Linked list
            3. Circular linked list
              1. Single Circular linked list
              2. Double Circular linked list

      Advantages of Linked List

      • Linked List is Dynamic data structure so they can grow and shrink during run time
      • On Linked list Insertion and Deletion Operations are Easier
      • Efficient Memory Utilization i.e no need to do any pre-allocation like Array.
      • Faster Access time,can be expanded in constant time without memory overhead in circular linked list.
      • Linear Data Structures such as Stack,Queue can be easily implemented using Linked list.  
      Disadvantages of Linked List
      • Extra memory is needed for storing the next link information using pointer. 
      • Array can be randomly accessed , while the Linked list cannot be accessed Randomly.
      • Individual nodes/elements are not stored in the contiguous (continues) memory Locations.

      Dev-C++ 5.6.3 installation Process on Windows 8 64/32 Bit operating System

      Description

      • Dev-C++ uses Mingw port of GCC (GNU Compiler Collection) as its compiler for Windows7 and Windows 8 Operating systems on 32\64bit version.
      • This Bloodshed Dev-C++ is a full-featured Integrated Development Environment (IDE) for the C/C++ programming language.
      • Dev C++ IDE creates native Win32 console and GUI application.

      Introduction To Data Structure and Types in C-Language

      • Data structure is a way of representation of relationship between logical related data elements.
      • In data structure, decision on the operations such as storage, retrieval and access must be carried out between the logically related data elements only.
      • Data Structure always describe about data representation in memory.

      Applications of Data Structure

      • Compiler Design
      • Operating System Design like Memory Management (Linked List + Hash-Map)
      • Database Management System(B-Tree)
      • File systems(Trees)
      • Statistical analysis package (Data mining algorithms)
      • Network data model(Graph)
      • Electronic circuit and simulation(Graphs)
      • Numerical Analysis,
      • Artificial Intelligence
      Types Of Data Structure
      1. Linear data structure

      2. Non-linear data structure

      • When Data Elements are arranged in sequential manner it is called Linear data structure. When we are working with  this type always a linear relationship is formatted between the elements with the help of sequential memory locations.
                                                         Ex:  Arrays, Stacks, Queues and Linked list.
      • In Non Linear Data structure data Elements are stored in hierarchical manner,  it forms the relation with the help of random memory locations.in this data structure in witch the elements are not arranged in a linear or sequential memory locations.
                                             Ex:  Tree, Graph, and Table.

      Installing Turbo C++ V3.0 on Windows 7/8 32bit Operating System with Maximized Window

      This is basic version c language IDE for beginners witch can be downloaded from my google drive.

      This compiler compactable to windows7 and windows8 32 bit OS only. 

      Installing Process

      • Download setup files from google drive and extract in local system.
      • Run SETUP.EXE
      • Select Next from welcome dialog box

      Loading/Saving C-Language programs from user specific path in Turbo-C++3.0.

      Generally Every C-Language Related Programs By Default Loaded From C:\TC\BIN Directory , so if we need to load from user specific path then follow this steps...
      • Create a new directory in local drive i.e. D or E or F. ( Ex:-  D:\CFILES )