Skip to content

ananyachibber21/Data_Structures_and_Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

Data Structure and Algorithms

A group of data elements that offer an effective way of storing and organising data in a computer so that it can be used effectively is referred to as a data structure. For instance, queues, stacks, linked lists, and arrays.

During runtime, data structures are created in memory for our programme to use.

Many algorithms rely heavily on data structures because they give programmers the tools they need to handle data effectively.

As the primary purpose of software is to quickly store and retrieve user data, it is essential for improving the performance of software or programmes.

Arrays

The first and one of the fundamental data structures of computer science: the array. An array is a homogeneous data structure: all elements are of the same type (int, string, etc). Also, the elements of an array are stored in adjacent memory locations.

Basic Operations on Arrays

  • Traversing
  • Searching
  • Insertion
  • Deletion
  • Sorting

LinkedList

A Linked List is a data structure composed of nodes: containers that each hold a single element. These nodes are "linked" to one another via pointers. Typically, we maintain one global head pointer (i.e., a pointer to the first node in the Linked List) and one global tail pointer (i.e., a pointer to the last node in a Linked List). These are the only two nodes to which we have direct access, and all other nodes can only be accessed by traversing pointers starting at either the head or the tail node.

There are several types of linked lists. Here are some of the most common types of linked lists that come in interviews and technical rounds:

  • Singly Linked List: In a singly linked list, each node points to the next node in the sequence. It is a linear data structure where elements are connected sequentially. Doubly Linked List:

  • Doubly Linked List: Each node contains a data element and two pointers, one pointing to the next node and another pointing to the previous node. This allows for traversal in both directions.

  • Circular Linked List: In a circular linked list, the last node points back to the first node, forming a circle. It can be singly or doubly linked.

  • Doubly Circular Linked List: A doubly circular linked list is a variation of a doubly linked list where the last node in the list points back to the first node, forming a circular structure. In addition to the features of a doubly linked list, it allows for bidirectional traversal and circular iteration.

Releases

No releases published

Packages

No packages published