Posts

Showing posts from March, 2024

Linked List Data Structures

Image
  Linked List Previous and next pointers are the connectors that connect the nodes. In one node previous pointer become the   next node’s previous pointer. If we add node to the Linked List we can add it using the next pointer, and if we want to remove also we can remove it along with the node’s next pointer.   A linked list is a linear collection of elements, called nodes, where each node holds a reference to the next node in the sequence. Unlike arrays, linked list elements are not stored in contiguous memory locations. Instead, each node contains data and a pointer/reference to the next node. Types of Linked Lists   1. Singly Linked Lists:    In a singly linked list, each node points to the next node in the sequence. The last node points to null, indicating the end of the list. Singly linked lists are simple to implement and memory-efficient.   2. Doubly Linked Lists:     In a doubly linked list, each node has pointers to b...

Array and Array List Data Structures

Image
  Array and Array List In data structures the simplest data structure is the Array. To store the data the simplest way is that.   We should know two   main things to create a list, -         In the Array we can only use the same typed data(same of data type among all elements). -         Array should be fixed sized.        That means we should know the size of the array before creating the array, how many data elements we want to store in that.         We should give the exact size of the array.   Why we want Array List   Array should fixed sized, but array list is not like that it is not fixed one. It’s resizable. Array List change there size according to our input data, In other way we can tell that as Dynamic Array or the Dynamic Array List.     arrays and array lists are both important data...

Stack and Queue Data structures

Image
  Queue and stack   Stack Store the data as a real world stack we called this structure as the stack data structure. Stack is what store something   one another something. If we get a real world example collection of CDs are good example. Those are store in one on another. In there If we want to add another CD we have to add it to last CD’s up   and In other side if we want to remove CD from that CD collection in that case   also we do as remove from last added one to inside. So the Concept of the Queue is the FIRST IN -LAST OUT or in other way we can tell it as LAST IN -FIRST OUT. In PUSH operation we should have to give the value to the parameter, but POP is not require any value because POP removes the upper value of the stack indeedly. Those processes are shows bellow, Some key points related to stack It behaves like a real-world stack, piles of books, etc. A Stack store the limited data only. Follow some structure to insert...

Data Structures

Image
  Data Structures   When   store data in computer we use different structures those structures we called   Data Structures. Because of these data structures   we can easily handle and easily operate the contain data.   Data Structures do arrange data in suitable structure and manage those data. Data structures organizes data in   memory that consider the elements store and there relationships to each other.   They provide a way to manage and manipulate data effectively, faster access, and the operations insertion and deletion and others.   Common data structures   ·         Arrays ·         Linked lists ·         Stacks ·         Queue ·         Tree ·         Graphs   Data Structures help organ...