Python vs JavaScript - Javatpoint
Python is mainly used for server-side programming, while JavaScript runs on both the server and the browser. Python is easy to start programming than JavaScript ...
data structure
Python is a dynamically semantic, interpreted, object-oriented, and high-level programming language. It's a built-in <anchor>data structure</anchor> with dynamic bindin g and dynamic typing at a high level. It serves as a scripting or glue language for connecting existing components and for creating the Rapid Application. It has a simple, easy-to-understand syntax that emphasizes readability, lowering software maintenance costs. It supports modules and packages and allowing programs to be more modular and reusable. The Python interpreter and robust standard library are free to use and distribute in source or binary form for all major platforms.
Data Structures | DS Tutorial - javatpoint
Data Structures \| DS Tutorial - javatpoint

[![Logo](/static/img/logo.png)](/)

Tutorials

×

### Frontend

[HTML](/html-tutorial) [CSS](/css-tutorial) [Bootstrap](/bootstrap-tutorial) [Jquery](/jquery-tutorial) [React](/reactjs-tutorial) [Angular](/angularjs-tutorial)

### Data Analytics

[Excel](/excel-tutorial) [Tableau](/tableau) [Power BI](/power-bi) [NumPy](/numpy-tutorial) [Panda](/python-pandas) [Scipy](/python-scipy)

### Database

[Sql](/sql-tutorial) [Mongo DB](/mongodb-tutorial) [Oracle](/oracle-tutorial) [Maria DB](/mariadb-tutorial) [PostgreSQL](/postgresql-tutorial) [Sql Server](/sql-server-tutorial)

### Online Compiler

[C](/compiler/c) [C++](/compiler/c++) [Php](/compiler/php) [Java](/compiler/java) [Html](/compiler/html) [Python](/compiler/python) [Javascript](/compiler/javascript)

### Backend

[Python](/python-tutorial) [Node Js](/nodejs-tutorial) [MySQL](/mysql-tutorial) [PHP](/php-tutorial) [Java](/java-tutorial) [C#](/c-sharp-tutorial) [R](/r-tutorial) [Kotlin](/kotlin-tutorial) [Django](/django-tutorial) [PostgreSQL](/postgresql-tutorial) [Spring Boot](/spring-boot-tutorial) [Ruby](/ruby-tutorial) [Go](/go-tutorial) [Rust](/rust-tutorial)

Interview

×

### Technical Interview

[C](/c-interview-questions) [C++](/cpp-interview-questions) [Php](/php-interview-questions) [Java](/corejava-interview-questions) [Python](/python-interview-questions) [JavaScript](/javascript-interview-questions) [TypeScript](/typescript-interview-questions)

### Java Interview

[JDBC](/jdbc-interview-questions) [Servlet](/servletinterview) [Maven](/maven-interview-questions) [Jenkins](/jenkins-interview-questions) [Spring](/spring-interview-questions) [Spring Boot](/spring-boot-interview-questions) [JDB](/jdb-interview-questions) [Hibernate](/hibernate-interview-questions) [JSF](/jsf-interview-questions)

### Web Interview

[HTML](/html-interview-questions) [CSS](/css-interview-questions) [JavaScript](/javascript-interview-questions) [Jquery](/jquery-interview-questions) [Angular](/angular-interview-questions) [Node-JS](/node-js-interview-questions) [AJAX](/ajax-interview-questions)

### Database Interview

[DBMS](/dbms-interview-questions) [SQL](/sql-interview-questions) [PL/SQL](/pl-sql-interview-questions) [Oracle](/oracle-interview-questions) [MySQL](/mysql-interview-questions) [MongoDB](/mongodb-interview-questions) [Redis](/redis-interview-questions-and-answers) [MariaDB](/mariadb-interview-questions)

### Company Interviews

[IBM](/ibm-interview-questions) [Adobe](/adobe-interview-questions) [Microsoft](/microsoft-interview-questions) [Amazon](/amazon-interview-questions) [TCS](/tcs-interview-questions) [HCL](/hcl-interview-questions) [Wipro](/wipro-interview-questions) [DXC](/dxc-technology-interview-questions) [Accenture](/accenture-interview-questions) [Capgemini](/capgemini-interview-questions) [Space X](/spacex-interview-questions) [Ericsson](/ericsson-interview-questions) [Infosy](/infosys-interview-questions) [IGate](/igate-interview-questions) [EXL](/exl-interview-questions) [IndiaMART](/indiamart-interview-questions) [Sapient](/sapient-interview-questions)

Compiler
- [C](/compiler/c)
- [R](/compiler/r)
- [C++](/compiler/c++)
- [Php](/compiler/php)
- [Java](/compiler/java)
- [Html](/compiler/html)
- [Swift](/compiler/swift)
- [Python](/compiler/python)
- [Javascript](/compiler/javascript)
- [Typescript](/compiler/typescript)

- [![home](https://static.javatpoint.com/images/icon/home.png)Home](/)
- [![python](https://static.javatpoint.com/images/icon/python.png) Python](/python-tutorial)
- [![java](https://static.javatpoint.com/images/icon/java.png) Java](/java-tutorial)
- [![javascript](https://static.javatpoint.com/images/icon/js.png) JavaScript](/javascript-tutorial)
- [![html](https://static.javatpoint.com/images/icon/html.png)HTML](/html-tutorial)
- [![sql](https://static.javatpoint.com/images/icon/sql.png) SQL](/sql-tutorial)
- [![php](https://static.javatpoint.com/images/icon/php.png) PHP](/php-tutorial)
- [![c#](https://static.javatpoint.com/images/icon/csharp.png) C#](/c-sharp-tutorial)
- [![c++](https://static.javatpoint.com/images/icon/cpp.png) C++](/cpp-tutorial)
- [![data structures](https://static.javatpoint.com/images/icon/ds.png) DS](/data-structure-tutorial)
- [![aptitude](https://static.javatpoint.com/images/icon/aptitude.png) Aptitude](/aptitude/quantitative)
- [![reasoning](https://static.javatpoint.com/images/icon/reasoning.png) Reasoning](/reasoning)
- [![selenium](https://static.javatpoint.com/images/icon/selenium.png) Selenium](/selenium-tutorial)
- [![dbms](https://static.javatpoint.com/images/icon/dbms.png) DBMS](/dbms-tutorial)
- [![c](https://static.javatpoint.com/images/icon/c.png) C](/c-programming-language-tutorial)
- [![android](https://static.javatpoint.com/images/icon/android.png) Andriod](/android-tutorial)
- [![interview questions](https://static.javatpoint.com/images/icon/interview.png) Interview Q](/interview-tips)

## DS Tutorial

- [DS Tutorial](/data-structure-tutorial)
- [DS Introduction](/data-structure-introduction)
- [DS Algorithm](/data-structure-algorithm)
- [Asymptotic Analysis](/data-structure-asymptotic-analysis)
- [DS Pointer](/data-structure-pointer)
- [DS Structure](/data-structure-structure)

## DS Array

- [DS Array](/data-structure-array)
- [2D Array](/data-structure-2d-array)

## DS Linked List

- [Linked List](/ds-linked-list)
- [Types of Linked List](/ds-types-of-linked-list)
- [Singly Linked List](/singly-linked-list)
- [Doubly Linked List](/doubly-linked-list)
- [Circular Linked List](/circular-singly-linked-list)
- [Circular Doubly List](/circular-doubly-linked-list)
- [Skip list in DS](/skip-list-in-data-structure)

## DS Stack

- [DS Stack](/data-structure-stack)
- [Array Implementation](/ds-array-implementation-of-stack)
- [Linked List Implementation](/ds-linked-list-implementation-of-stack)

## DS Queue

- [DS Queue](/data-structure-queue)
- [Types of Queues](/ds-types-of-queues)
- [Array Representation](/array-representation-of-queue)
- [Linked List Representation](/linked-list-implementation-of-queue)
- [Circular Queue](/circular-queue)
- [Deque](/ds-deque)
- [Priority Queue](/ds-priority-queue)

## DS Tree

- [DS Tree](/tree)
- [Binary Tree](/binary-tree)
- [Binary Search Tree](/binary-search-tree)
- [AVL Tree](/avl-tree)
- [B Tree](/b-tree)
- [B+ Tree](/b-plus-tree)
- [Red-black tree](/red-black-tree)

## DS Graph

- [DS Graph](/ds-graph)
- [Graph Implementation](/graph-representation)
- [BFS Algorithm](/breadth-first-search-algorithm)
- [DFS Algorithm](/depth-first-search-algorithm)
- [Spanning Tree](/spanning-tree)
- [a)Prim's Algorithm](/prim-algorithm)
- [b)Kruskal's Algorithm](/kruskal-algorithm)

## DS Searching

- [Linear Search](/linear-search)
- [Binary Search](/binary-search)

## DS Sorting

- [Bubble Sort](/bubble-sort)
- [Bucket Sort](/bucket-sort)
- [Comb Sort](/comb-sort)
- [Counting Sort](/counting-sort)
- [Heap Sort](/heap-sort)
- [Insertion Sort](/insertion-sort)
- [Merge Sort](/merge-sort)
- [Quick Sort](/quick-sort)
- [Radix Sort](/radix-sort)
- [Selection Sort](/selection-sort)
- [Shell Sort](/shell-sort)
- [Bitonic Sort](/bitonic-sort)
- [Cocktail Sort](/cocktail-sort)
- [Cycle Sort](/cycle-sort)
- [Tim Sort](/tim-sort)

## Differences

- [Linear vs non-linear](/linear-vs-non-linear-data-structure)
- [Array vs linked list](/ds-array-vs-linked-list)
- [Stack vs queue](/ds-stack-vs-queue)
- [Linear vs Circular Queue](/ds-linear-vs-circular-queue)
- [Linear Search vs Binary Search](/ds-linear-search-vs-binary-search)
- [Singly Linked List vs Doubly Linked List](/singly-linked-list-vs-doubly-linked-list)
- [Binary vs Binary Search Tree](/binary-tree-vs-binary-search-tree)
- [Tree vs Graph](/tree-vs-graph-data-structure)
- [Binary Search tree vs AVL tree](/binary-search-tree-vs-avl-tree)
- [Red Black Tree vs AVL tree](/red-black-tree-vs-avl-tree)
- [B tree vs B+ tree](/b-tree-vs-bplus-tree)
- [Quick Sort vs Merge Sort](/quick-sort-vs-merge-sort)
- [BFS vs DFS](/bfs-vs-dfs)
- [Stack vs Heap](/stack-vs-heap)
- [Bubble sort vs. Selection sort](/bubble-sort-vs-selection-sort)
- [Stack vs Array](/ds-stack-vs-array)
- [Full Binary Tree vs Complete Binary Tree](/full-binary-tree-vs-complete-binary-tree)
- [Binary Tree vs B Tree](/binary-tree-vs-b-tree)
- [Primitive vs non-primitive data structure](/primitive-vs-non-primitive-data-structure)
- [Data types vs data structure](/data-types-vs-data-structure)

## Misc

- [Trie Data Structure](/trie-data-structure)
- [Heap Data Structure](/heap-data-structure)
- [Splay Tree](/splay-tree)
- [Fundamental of the DS](/fundamental-of-the-data-structure)
- [Hash Table](/hash-table)
- [Preorder Traversal](/preorder-traversal)
- [Tree Traversal](/tree-traversal)
- [Implementation of Queue using Stacks](/implementation-of-queue-using-stacks)
- [Implementation of Stack using Queue](/implementation-of-stack-using-queue)
- [Binomial Heap](/binomial-heap)
- [Postorder Traversal](/postorder-traversal)
- [Sparse Matrix](/sparse-matrix)
- [Detect loop in a Linked list](/detect-loop-in-a-linked-list)
- [Inorder Traversal](/inorder-traversal)
- [Convert Infix to Postfix notation](/convert-infix-to-postfix-notation)
- [Convert infix to prefix notation](/convert-infix-to-prefix-notation)
- [Conversion of Prefix to Postfix expression](/conversion-of-prefix-to-postfix-expression)
- [Conversion of Postfix to Prefix expression](/conversion-of-postfix-to-prefix-expression)
- [Remove the loop in a Linked List](/remove-loop-in-a-linked-list)
- [Implement two stacks in an array](/implement-two-stacks-in-an-array)
- [Reverse a stack using recursion](/reverse-a-stack-using-recursion)
- [Detect cycle in a directed graph](/detect-cycle-in-a-directed-graph)
- [Optimal Binary Search Tree](/optimal-binary-search-tree)
- [Priority Queue using Linked list](/priority-queue-using-linked-list)
- [Balanced Binary Search Tree](/balanced-binary-search-tree)
- [Boundary Traversal of Binary tree](/boundary-traversal-of-binary-tree)
- [Diagonal Traversal of Binary Tree](/diagonal-traversal-of-binary-tree)
- [Vertical Traversal of a Binary tree](/vertical-traversal-of-a-binary-tree)
- [Graph Algorithms](/graph-algorithms)
- [Time Complexity of Sorting Algorithms](/time-complexity-of-sorting-algorithms)
- [Applications of Stack in Data Structure](/applications-of-stack-in-data-structure)
- [Dictionary Data Structure](/dictionary-data-structure)
- [Structured Data and Unstructured Data](/structured-data-and-unstructured-data)
- [List Data Structure](/list-data-structure)
- [Types of Tree in Data Structure](/types-of-tree-in-data-structure)
- [Abstract data type in data structure](/abstract-data-type-in-data-structure)
- [Disjoint set data structure](/disjoint-set-data-structure)
- [Dynamic Data Structure](/dynamic-data-structure)
- [Hash Function in Data Structure](/hash-function-in-data-structure)
- [Complete Binary Tree](/complete-binary-tree)
- [Threaded Binary Tree](/threaded-binary-tree)
- [Diameter of Binary Tree](/diameter-of-binary-tree)
- [Height of Binary Tree](/height-of-binary-tree)
- [Inorder Tree Traversal without Stack](/inorder-tree-traversal-without-stack)
- [Enumeration of Binary Trees](/enumeration-of-binary-trees)
- [Maximum Width of a Binary Tree](/maximum-width-of-a-binary-tree)
- [Types of Graph in Data Structure](/types-of-graph-in-data-structure)
- [Primitive Data Type](/primitive-data-type)
- [Semi-Structured Data](/semi-structured-data)
- [Advance Data Structures](/advance-data-structures)
- [Sort an Array of 0's, 1's, and 2's](/sort-an-array-of-0s-1s-and-2s)
- [Stock Span Problem](/stock-span-problem)
- [Implementation of Deque by Circular Array](/implementation-of-deque-by-circular-array)
- [Rotate Operation in Linked List](/rotate-operation-in-linked-list)
- [Subarray with given sum](/subarray-with-given-sum)
- [Self-organizing List](/self-organizing-list)
- [Unrolled Linked List](/unrolled-linked-list)
- [Types of Sparse Matrices](/types-of-sparse-matrices)
- [Application of Linked List](/application-of-linked-list)
- [Topological Sorting](/topological-sorting)
- [Ternary Search Tree](/ternary-search-tree)
- [Stock Span Problem](/stock-span-problem)
- [Treap Data Structure](/treap-data-structure)
- [Quicksort on Doubly Linked List](/quicksort-on-doubly-linked-list)
- [Inversion count](/inversion-count)
- [Expression tree in DS](/expression-tree-in-data-structure)
- [Garbage Collection in DS](/garbage-collection-in-data-structure)
- [Merge Sort on Doubly Linked List](/merge-sort-on-doubly-linked-list)
- [Sort Stack using Recursion](/sort-stack-using-recursion)
- [LIFO Approach in data structure](/lifo-approach-in-data-structure)
- [Big O Notation in DS](/big-O-notation-in-data-structure)
- [Binary Tree Traversal in DS](/binary-tree-traversal-in-data-structure)
- [Queue Operations in DS](/queue-operations-in-data-structure)
- [What is a Non-Linear Data Structure](/what-is-a-non-linear-data-structure)
- [FIFO Approach in data structure](/fifo-approach-in-data-structure)
- [What are connected graphs in data structure](/what-are-connected-graphs-in-data-structure)
- [Which Python data structure is immutable](/which-python-data-structure-is-immutable)
- [Which data structure is used by map](/which-data-structure-is-used-by-map)
- [What is iteration in data structure](/what-is-iteration-in-data-structure)
- [What are linear search and binary search in data structure](/what-are-linear-search-and-binary-search-in-data-structure)
- [Hash Table vs STL Map](/hash-table-vs-stl-map)
- [Recaman's Sequence](/recamans-sequence)
- [Maximum area rectangle created by selecting four sides from an array](/maximum-area-rectangle-created-by-selecting-four-sides-from-an-array)
- [Maximum number of distinct nodes in a root-to-leaf path](/maximum-number-of-distinct-nodes-in-a-root-to-leaf-path)
- [Hashing - Open Addressing for Collision Handling](/hashing-open-addressing-for-collision-handling)
- [Introduction to Hashing](/introduction-to-hashing)
- [Separate chaining for Collision Handling](/separate-chaining-for-collision-handling)
- [Check if a given array contains duplicate elements within k distance from each other](/check-if-a-given-array-contains-duplicate-elements-within-k-distance-from-each-other)
- [Given an array A\[\] and a number x, check for pair in A\[\] with sum as x (aka Two Sum)](/given-an-array-a-and-a-number-x-check-for-pair-in-a-with-sum-as-x)
- [Find number of Employees Under every Manager](/find-number-of-employees-under-every-manager)
- [Union and Intersection of two Linked Lists](/union-and-intersection-of-two-linked-lists)
- [Kth Largest element in an array](/kth-largest-element-in-an-array)
- [Sort an almost-sorted, k-sorted or nearly-sorted array](/sort-an-almost-sorted-k-sorted-or-nearly-sorted-array)
- [Fibonacci Heap](/fibonacci-heap)
- [Find whether an array is subset of another array](/find-whether-an-array-is-subset-of-another-array)
- [Print a Binary Tree in Vertical Order](/print-a-binary-tree-in-vertical-order)
- [Tournament Tree (Winner Tree)](/tournament-tree)
- [Lazy Propagation in Segment Tree](/lazy-propagation-in-segment-tree)
- [Segment Tree - Range Minimum Query](/segment-tree-range-minimum-query)
- [Segment Tree - Sum of given Range](/segment-tree-sum-of-given-range)
- [2-3 Trees (Search, Insertion, and Deletion)](/2-3-trees-search-insertion-and-deletion)
- [Print kth least significant bit of a number](/print-kth-least-significant-bit-of-a-number)
- [Add two numbers represented by linked lists](/add-two-numbers-represented-by-linked-lists)
- [Adding one to the number represented as array of digits](/adding-one-to-the-number-represented-as-array-of-digits)
- [Find precedence characters form a given sorted dictionary](/find-precedence-characters-form-a-given-sorted-dictionary)
- [Check if any anagram of a string is palindrome or not](/check-if-any-anagram-of-a-string-is-palindrome-or-not)
- [Minimum Insertions to form a Palindrome](/minimum-insertions-to-form-a-palindrome)
- [Allocate Minimum Number of Pages](/allocate-minimum-number-of-pages)
- [Assembly Line Scheduling](/assembly-line-scheduling)
- [Breadth First Search or BFS for a Graph](/breadth-first-search-or-bfs-for-a-graph)
- [Find an element in array such that sum of the left array is equal to the sum of the right array](/find-an-element-in-array-such-that-sum-of-the-left-array-is-equal-to-the-sum-of-the-right-array)
- [Bridges in a Graph](/bridges-in-a-graph)
- [Bubble Sort in JavaScript](/bubble-sort-in-javascript)
- [Burn the Binary tree from the Target node](/burn-the-binary-tree-from-the-target-node)
- [Lowest Common Ancestor in a Binary Search Tree](/lowest-common-ancestor-in-a-binary-search-tree)
- [Types of Hash Functions in C](/types-of-hash-functions-in-c)
- [Implement Dynamic Deque using Templates Class and a Circular Array](/implement-dynamic-deque-using-templates-class-and-a-circular-array)
- [Iterative Depth First Traversal of Graph](/iterative-depth-first-traversal-of-graph)
- [Linked List Data Structure in C++ With Illustration](/linked-list-data-structure-in-cpp-with-illustration)
- [Reverse a Linked List in Groups of Given Size](/reverse-a-linked-list-in-groups-of-given-size)
- [Reverse Alternate K nodes in a Singly Linked List](/reverse-alternate-k-nodes-in-a-singly-linked-list)
- [When should I use a List vs a LinkedList](/when-should-i-use-a-list-vs-a-linkedlist)
- [Why is deleting in a Singly Linked List O(1)](/why-is-deleting-in-a-singly-linked-list-O-1)
- [Construct Full Binary Tree using its Preorder Traversal and Preorder Traversal of its Mirror Tree](/construct-full-binary-tree-using-its-preorder-traversal-and-preorder-traversal-of-its-mirror-tree)
- [Find Relative Complement of two Sorted Arrays](/find-relative-complement-of-two-sorted-arrays)
- [Handshaking Lemma and Interesting Tree Properties -DSA](/handshaking-lemma-and-interesting-tree-properties-dsa)
- [How to Efficiently Implement kStacks in a Single Array](/how-to-efficiently-implement-kstacks-in-a-single-array)
- [Write C Functions that Modify Head Pointer of a Linked List](/write-c-functions-that-modify-head-pointer-of-a-linked-list)
- [Introduction to Ant Colony Optimization](/introduction-to-ant-colony-optimization)
- [What is Array](/what-is-array)
- [The practical Byzantine Fault Tolerance (pBFT)](/practical-byzantine-fault-tolerance)
- [Applications of Queue Data Structure](/applications-of-queue-data-structure)
- [Line Graph](/line-graph)
- [Symmetric Binary Tree](/symmetric-binary-tree)
- [AVL Tree Advantages](/avl-tree-advantages)
- [AVL Tree Time Complexity](/avl-tree-time-complexity)
- [Merge Two Binary Trees](/merge-two-binary-trees)
- [Stack Operations in Data Structure](/stack-operations-in-data-structure)
- [Self-Balancing Binary Search Trees](/self-balancing-binary-search-trees)
- [Sliding Window Maximum (Maximum of all Subarrays of size K)](/sliding-window-maximum-maximum-of-all-subarrays-of-size-k)
- [AVL Trees Operations](/avl-trees-operations)
- [Limitations of Stack in Data Structures](/limitations-of-sack-in-data-structures)
- [Representation of stack in data structure](/representation-of-stack-in-data-structure)
- [Advantages of Threaded Binary Tree](/advantages-of-threaded-binary-tree)
- [Serialize and Deserialize a Binary Tree](/serialize-and-deserialize-a-binary-tree)
- [Application of Binary Tree](/application-of-binary-tree)
- [AVL Tree Applications](/avl-tree-applications)
- [B Tree Visualization](/b-tree-visualization)
- [Properties of AVL Trees](/properties-of-avl-trees)
- [Push and Pop Operation in Stack in Data Structure](/push-and-pop-operation-in-stack-in-data-structure)
- [Binary Search Tree Implementation](/binary-search-tree-implementation)
- [Find Maximum Sum by Replacing the Subarray in Given Range](/find-maximum-sum-by-replacing-the-subarray-in-given-range)
- [Find The Number N, Where (N+X) Divisible By Y And (N-Y) Divisible By X](/find-the-number-n-where-n-x-divisible-by-y-and-n-y-divisible-by-x)
- [Find Values of P and Q Satisfying the Equation N = P^2.Q](/find-values-of-p-and-q-satisfying-the-equation-n-p-2-q)
- [What is the Balance Factor of AVL Tree](/what-is-the-balance-factor-of-avl-tree)
- [AVL Tree Implementation in Golang](/avl-tree-implementation-in-golang)
- [Concatenation of two Linked Lists in O(1) time](/concatenation-of-two-linked-lists-in-o-1-time)
- [Find Minimum Area of Rectangle Formed from Given Shuffled Coordinates](/find-minimum-area-of-rectangle-formed-from-given-shuffled-coordinates)
- [Find the Length of Maximum Path in Given Matrix for Each Index](/find-the-length-of-maximum-path-in-given-matrix-for-each-index)
- [How to Parse an Array of Objects in C++ Using RapidJson](/how-to-parse-an-array-of-objects-in-cpp-using-rapidjson)
- [Largest BST in Binary Tree](/largest-bst-in-binary-tree)
- [How to Print String Literal and Qstring With Qdebug in C++](/how-to-print-string-literal-and-qstring-with-qdebug-in-cpp)
- [Properties of Binary Tree](/properties-of-binary-tree)
- [Right View of Binary Tree](/right-view-of-binary-tree)
- [Strict Binary Tree](/strict-binary-tree)
- [Difference between Comb Sort and Shell Sort](/difference-between-comb-sort-and-shell-sort)
- [Full Binary Tree](/full-binary-tree)
- [Left View of a Binary Tree](/left-view-of-a-binary-tree)
- [Level order Traversal in a Binary Tree](/level-order-traversal-in-a-binary-tree)
- [Lowest Common Ancestor of a Binary Tree](/lowest-common-ancestor-of-a-binary-tree)
- [Top View of a Binary Tree](/top-view-of-a-binary-tree)
- [Types of Binary Trees](/types-of-binary-trees)
- [B Tree Insertion](/b-tree-insertion)
- [Evaluation of a Postfix notation](/evaluation-of-a-postfix-notation)
- [B+ Tree Insertion](/b-plus-tree-insertion)
- [Bottom View of a Binary Tree](/bottom-view-of-a-binary-tree)
- [AVL Tree Program in C](/avl-tree-program-in-c)
- [B Tree Applications](/b-tree-applications)
- [B Tree Properties](/b-tree-properties)
- [How to Search, Insert, and Delete in an Unsorted Array](/how-to-search-insert-and-delete-in-an-unsorted-array)
- [Count Non-Leaf Nodes in a Binary Tree](/count-non-leaf-nodes-in-a-binary-tree)
- [Get the Level of a Given Key in a Binary Tree](/get-the-level-of-a-given-key-in-a-binary-tree)
- [Double Ended Priority Queue](/double-ended-priority-queue)
- [B+ Tree Deletion](/bplus-tree-deletion)
- [B+ Tree Insertion](/bplus-tree-insertion)
- [Checking for the Mirror Images in the Binary Trees](/checking-for-the-mirror-images-in-the-binary-trees)
- [Count Non-Leaf Nodes in a Binary Tree](/count-non-leaf-nodes-in-a-binary-tree)
- [Get a Parent Binary Tree](/get-a-parent-binary-tree)
- [Get All Descendants of the Binary Tree Element](/get-all-descendants-of-the-binary-tree-element)
- [Get the Level of a Given Key in a Binary Tree](/get-the-level-of-a-given-key-in-a-binary-tree)
- [Flatten Binary Tree to Linked List](/flatten-binary-tree-to-linked-list)
- [Formula to Find a Level of the Node in a Binary Tree](/formula-to-find-a-level-of-the-node-in-a-binary-tree)
- [Substring with Maximum Number of Vowels of Given Length (k)](/substring-with-maximum-number-of-vowels-of-given-length-k)
- [Flatten Binary Tree to Sorted Linked List](/flatten-binary-tree-to-sorted-linked-list)
- [Floor and Ceiling in Binary Search Tree](/floor-and-ceiling-in-binary-search-tree)
- [Find Level in a Binary Tree with Max Sum](/find-level-in-a-binary-tree-with-max-sum)
- [Find kth Smallest Element in a Binary Search Tree](/find-kth-smallest-element-in-a-binary-search-tree)
- [Find Next Greater Element in Binary Tree](/find-next-greater-element-in-binary-tree)
- [Hashing in Data Structure](/hashing-in-data-structure)
- [Primitive Data Structure](/primitive-data-structure)
- [Find if Binary Tree Satisfies Balanced Height Property](/find-if-binary-tree-satisfies-balanced-height-property)
- [Find the Largest Perfect Binary Tree in a Given Tree](/find-the-largest-perfect-binary-tree-in-a-given-tree)
- [Find Immediate Parents of Two Nodes in a Binary Tree](/find-immediate-parents-of-two-nodes-in-a-binary-tree)
- [Applications, Advantages and Disadvantages of Circular Doubly linked List](/applications-advantages-and-disadvantages-of-circular-doubly-linked-list)
- [Sorting Techniques in Data Structures](/sorting-techniques-in-data-structures)
- [Find Clockwise Array in Binary Search Tree](/find-clockwise-array-in-binary-search-tree)
- [Find Duplicate Subtrees in Binary Tree](/find-duplicate-subtrees-in-binary-tree)
- [Find the Index of the Number Using a Binary Tree](/find-the-index-of-the-number-using-a-binary-tree)
- [Find the In-Order Successor of a Node in a Binary Tree](/find-the-in-order-successor-of-a-node-in-a-binary-tree)
- [Reversing a Queue](/reversing-a-queue)
- [Different Types of Stack Operations](/different-types-of-stack-operations)
- [Time Complexity in Data Structure](/time-complexity-in-data-structure)
- [Arrays are best Data Structure](/arrays-are-best-data-structure)
- [Dynamic memory allocation in Data Structure](/dynamic-memory-allocation-in-data-structure)
- [Application of Data Structure](/application-of-data-structure)
- [Applications of Tree in Data Structure](/applications-of-tree-in-data-structure)
- [How to Check if a Binary Number is Divisible by 3](/how-to-check-if-a-binary-number-is-divisible-by-3)
- [Stock Buy and Sell Problem](/stock-buy-and-sell-problem)
- [Find Minimum in Rotated Sorted Array](/find-minimum-in-rotated-sorted-array)
- [Interpolation Search vs. Binary Search](/interpolation-search-vs-binary-search)
- [Boggle (find all possible words in a board of characters)](/boggle-find-all-possible-words-in-a-board-of-characters)
- [Difference Between Prim's and Kruskal's algorithm](/difference-between-prims-and-kruskals-algorithm)
- [Interpolation Search](/interpolation-search)
- [Quick Sort Using Hoare's Partition](/quick-sort-using-hoares-partition)
- [Longest common substring](/longest-common-substring)
- [Longest Repeated Substring](/longest-repeated-substring)
- [Substring Check](/substring-check)
- [Clone a Binary Tree with Random Pointers](/clone-a-binary-tree-with-random-pointers)
- [How to efficiently implement k stacks in a single array](/how-to-efficiently-implement-k-stacks-in-a-single-array)
- [Kasai's algorithm for construction of LCP array from Suffix array](/kasais-algorithm-for-construction-of-lcp-array-from-suffix-array)
- [Strassen's Matrix Multiplication](/strassens-matrix-multiplication)
- [suffix array introduction](/suffix-array-introduction)
- [Suffix Array nLogn Algorithm](/suffix-array-nlogn-algorithm)
- [Suffix tree introduction](/suffix-tree-introduction)
- [Binary indexed tree](/binary-indexed-tree)
- [Given a n x n square matrix, find the sum of all sub-squares of size k x k](/given-a-n-x-n-square-matrix-find-the-sum-of-all-sub-squares-of-size-k-x-k)
- [Inplace MxN size matrix transpose](/inplace-mxn-size-matrix-transpose)
- [longest palindrome substring](/longest-palindrome-substring)
- [Maximum Size Square Sub-matrix with all 1s](/maximum-size-square-sub-matrix-with-all-1s)
- [Maximum Sum Rectangle in a 2D Matrix](/maximum-sum-rectangle-in-a-2d-matrix)
- [Printing All Elements in Sorted Order from Row and Column Wise Sorted Matrix](/printing-all-elements-in-sorted-order-from-row-and-column-wise-sorted-matrix)
- [Arraylist vs linked list](/arraylist-vs-linked-list)
- [Diameter of an N-ary Tree](/diameter-of-an-n-ary-tree)
- [Generic Trees (N-ary Trees)](/generic-trees-n-ary-trees)
- [Level Order Traversal of N-ary Tree](/level-order-traversal-of-n-ary-tree)
- [Mirror of n-ary Tree](/mirror-of-n-ary-tree)
- [Serialize and Deserialize an N-ary Tree](/serialize-and-deserialize-an-n-ary-tree)
- [Sum of all elements of N-ary Tree](/sum-of-all-elements-of-n-ary-tree)
- [The Great Tree-List Recursion Problem](/great-tree-list-recursion-problem)
- [Two dimensional Binary Indexed Tree or Fenwick Tree](/two-dimensional-binary-indexed-tree-or-fenwick-tree)
- [Binary Indexed Tree Range Updates and Point Queries](/binary-indexed-tree-range-updates-and-point-queries)
- [Binary Indexed Tree Range Updates and Range Queries](/binary-indexed-tree-range-updates-and-range-queries)
- [Closest greater or same value on left side for every element in array](/closest-greater-or-same-value-on-left-side-for-every-element-in-array)
- [Construct an array from its pair-sum array](/construct-an-array-from-its-pair-sum-array)
- [Equilibrium index of an array](/equilibrium-index-of-an-array)
- [Fermat's Factorization Method in Java](/fermats-factorization-method-in-java)
- [Find a triplet that sum to a given value in an array](/find-a-triplet-that-sum-to-a-given-value-in-an-array)
- [Find k numbers with most occurrences in the given array](/find-k-numbers-with-most-occurrences-in-the-given-array)
- [Find maximum value of Sum(i\*arr\[i\]) with only rotations on given array allowed](/find-maximum-value-of-sum-i-arr-with-only-rotations-on-given-array-allowed)
- [Handshaking Lemma and Interesting Tree Properties](/handshaking-lemma-and-interesting-tree-properties)
- [Implementation of Dynamic Segment Trees with Poly Hash Tables](/implementation-of-dynamic-segment-trees-with-poly-hash-tables)
- [Majority Element](/majority-element)
- [Maximum equilibrium sum in an array](/maximum-equilibrium-sum-in-an-array)
- [Maximum profit by buying and selling a share at most twice](/maximum-profit-by-buying-and-selling-a-share-at-most-twice)
- [Median in a stream of integers (running integers)](/median-in-a-stream-of-integers)
- [Merge Sort Tree for Range Order Statistics](/merge-sort-tree-for-range-order-statistics)
- [Merge two sorted arrays with O(1) extra space](/merge-two-sorted-arrays-with-O-1-extra-space)
- [Minimum increment by k operations to make all elements equal](/minimum-increment-by-k-operations-to-make-all-elements-equal)
- [Minimum number of jumps to reach end](/minimum-number-of-jumps-to-reach-end)
- [MO's Algorithm](/mos-algorithm)
- [Search in a row-wise and column-wise sorted matrix](/search-in-a-row-wise-and-column-wise-sorted-matrix)
- [Smallest subarray with sum greater than a given value](/smallest-subarray-with-sum-greater-than-a-given-value)
- [Sparse Table](/sparse-table)
- [Square Root (Sqrt) Decomposition Algorithm](/square-root-decomposition-algorithm)
- [Two Pointers Technique](/two-pointers-technique)
- [Compressed segment trees and merging sets in O(N\*logN)](/compressed-segment-trees-and-merging-sets-in-o-n-logn)
- [Intersection of Linked List](/intersection-of-linked-list)
- [Intersection Point in Y shaped linked list](/intersection-point-in-y-shaped-linked-list)
- [Make Array Zero By Subtracting Equal Amounts In Java](/make-array-zero-by-subtracting-equal-amounts-in-java)
- [Maximum Sum Pair with Equal Highest Digits](/maximum-sum-pair-with-equal-highest-digits)
- [Minimum Possible value of \|ai + aj - k\| for given array and k](/minimum-possible-value-of-ai-aj-k-for-given-array-and-k)
- [Tango Tree Data Structure](/tango-tree-data-structure)
- [Check if two arrays are equal or not](/check-if-two-arrays-are-equal-or-not)
- [Construct BST from its given level order traversal](/construct-bst-from-its-given-level-order-traversal)
- [Elements to be added so that all elements of a range are present in the array](/elements-to-be-added-so-that-all-elements-of-a-range-are-present-in-the-array)
- [Find Missing Elements in Range](/find-missing-elements-in-range)
- [K-th Largest Sum Contiguous Subarray](/k-th-largest-sum-contiguous-subarray)
- [Minimum number of subsets with distinct elements](/minimum-number-of-subsets-with-distinct-elements)
- [Minimum product of k integers in an array of positive integers](/minimum-product-of-k-integers-in-an-array-of-positive-integers)
- [The non-overlapping sum of two sets](/non-overlapping-sum-of-two-sets)
- [Palindrome substring queries](/palindrome-substring-queries)
- [Recaman's Sequence](/recamans-sequence)
- [The sum of Elements Between k1th and k2th smallest elements](/sum-of-elements-between-k1th-and-k2th-smallest-elements)
- [Print Matrix in a Snake Pattern](/print-matrix-in-a-snake-pattern)
- [An Interesting Method to Generate Binary Numbers from 1 to n](/an-interesting-method-to-generate-binary-numbers-from-1-to-n)
- [Bottom View of a Binary Tree](/bottom-view-of-a-binary-tree)
- [Circular List Application](/circular-list-application)
- [Deleting a Node in a Linked List](/deleting-a-node-in-a-linked-list)
- [Diameter of a Binary Tree](/diameter-of-a-binary-tree)
- [Find distance between two nodes of a Binary Search Tree](/find-distance-between-two-nodes-of-a-binary-tree)
- [Inorder Tree Traversal without Recursion](/inorder-tree-traversal-without-recursion)
- [Inorder Tree Traversal without recursion and stack!](/inorder-tree-traversal-without-recursion-and-stack)
- [Maximum product of indexes of next greater on left and right](/maximum-product-of-indexes-of-next-greater-on-left-and-right)
- [Print Left View of a Binary Tree](/print-left-view-of-a-binary-tree)
- [Remove all leaf nodes from the binary search tree](/remove-all-leaf-nodes-from-the-binary-search-tree)
- [Sort a stack using a temporary stack](/sort-a-stack-using-a-temporary-stack)
- [Split a Circular List into 2 Halves](/split-a-circular-list-into-2-halves)
- [Check given array of size n can represent BST of n levels or not](/check-given-array-of-size-n-can-represent-bst-of-n-levels-or-not)
- [Construct a linked list from 2D matrix](/construct-a-linked-list-from-2d-matrix)
- [In place, convert BST into a Min-Heap](/in-place-convert-bst-into-a-min-heap)
- [Polish and Reverse Polish Notation](/polish-and-reverse-polish-notation)
- [Suffix Trees in data structure](/suffix-trees-in-data-structure)
- [Weight Balanced Binary Tree](/weight-balanced-binary-tree)
- [Transform a BST to greater sum tree](/transform-a-bst-to-greater-sum-tree)
- [Vertical order traversal of Binary Tree using Map](/vertical-order-traversal-of-binary-tree-using-map)
- [Application of heap tree](/application-of-heap-tree)
- [Construct a linked list from 2D matrix](/construct-a-linked-list-from-2d-matrix)
- [Define Abstract Data Type in Data Structure](/define-abstract-data-type-in-data-structure)
- [Detect and Remove Loop in a Linked List](/detect-and-remove-loop-in-a-linked-list)
- [Difference Between a Tree and a Forest in Data Structures](/difference-between-a-tree-and-a-forest-in-data-structures)
- [Difference between bubble sort and merge sort](/difference-between-bubble-sort-and-merge-sort)
- [Difference between merge sort and quick sort](/difference-between-merge-sort-and-quick-sort)
- [Explain double ended queue in detail](/explain-double-ended-queue-in-detail)
- [Find the median from running data stream](/find-the-median-from-running-data-stream)
- [Flattening a Linked List](/flattening-a-linked-list)
- [Generate All Subarrays](/generate-all-subarrays)
- [Heap memory vs. stack memory](/heap-memory-vs-stack-memory)
- [Huffman encoding](/huffman-encoding)
- [Huffman Tree in Data Structure](/huffman-tree-in-data-structure)
- [Implementation of Graph in JavaScript](/implementation-of-graph-in-javascript)
- [K-D Tree in Data Structures](/k-d-tree-in-data-structures)
- [Knapsack Problem in Data Structure](/knapsack-problem-in-data-structure)
- [Largest Sum Contiguous Subarray (Kadane's Algorithm)](/largest-sum-contiguous-subarray-kadanes-algorithm)
- [Multiway Trees in Data Structures](/multiway-trees-in-data-structures)
- [Optimal binary search tree in data structure](/optimal-binary-search-tree-in-data-structure)
- [polynomial addition in data structure](/polynomial-addition-in-data-structure)
- [Postfix deferred queue](/postfix-deferred-queue)
- [Properties of tree in data structure](/properties-of-tree-in-data-structure)
- [Recurrence Relation of Merge Sort](/recurrence-relation-of-merge-sort)
- [Recursive Bubble Sort](/recursive-bubble-sort)
- [RSS linked list](/rss-linked-list)
- [Search in a Rotated Sorted Array](/search-in-a-rotated-sorted-array)
- [Sort an array of 0s, 1s and 2s \| Dutch National Flag problem](/sort-an-array-of-0s-1s-and-2s-dutch-national-flag-problem)
- [Assign directions to edges so that the directed graph remains acyclic](/assign-directions-to-edges-so-that-the-directed-graph-remains-acyclic)
- [Dependency Graph](/dependency-graph)
- [Diameter of an N-ary tree](/diameter-of-an-n-ary-tree)
- [Height of n-ary tree if parent array is given](/height-of-n-ary-tree-if-parent-array-is-given)
- [Introduction to Heavy Light Decomposition](/introduction-to-heavy-light-decomposition)
- [LCA in a binary tree using RMQ](/lca-in-a-binary-tree-using-rmq)
- [Number of Siblings of a given node in n-arr tree](/number-of-siblings-of-a-given-node-in-n-arr-tree)
- [Number of ways to traverse an N-arr](/number-of-ways-to-traverse-an-n-arr)
- [XOR Linked List - A Memory Efficient Doubly Linked List](/xor-linked-list-a-memory-efficient-doubly-linked-list)
- [Callback Queue](/callback-queue)
- [Inorder Predecessor and Successor in a Binary Search Tree](/inorder-predecessor-and-successor-in-a-binary-search-tree)
- [What is Internal Sorting](/what-is-internal-sorting)
- [Block Swap Algorithm for Array Rotation in Python](/block-swap-algorithm-for-array-rotation-in-python)
- [CHECK FOR BALANCED BRACKETS IN AN EXPRESSION (WELL FORMEDNESS)](/check-for-balanced-brackets-in-an-expression)
- [Count pairs from two BSTs whose sum is equal to given value x](/count-pairs-from-two-bsts-whose-sum-is-equal-to-given-value-x)
- [Counting Inversions Problem in Data Structure](/counting-inversions-problem-in-data-structure)
- [Differences between Insertion Sort and Selection Sort](/differences-between-insertion-sort-and-selection-sort)
- [LEFTIST TREE / LEFTIST HEAP](/leftist-tree-leftist-heap)
- [Find if there is a triplet in a balanced bst that adds to zero](/find-if-there-is-a-triplet-in-a-balanced-bst-that-adds-to-zero)
- [Find the Maximum English Letter Present in Both Lowercase and Uppercase](/find-the-maximum-english-letter-present-in-both-lowercase-and-uppercase)
- [K-way Merge Sort](/k-way-merge-sort)
- [Perfect Binary Trees](/perfect-binary-trees)
- [Reverse Sort](/reverse-sort)
- [Scapegoat Trees](/scapegoat-trees)
- [Stack Organisation](/stack-organisation)
- [Time Complexity of using heap](/time-complexity-of-using-heap)
- [Two-way merge sort](/two-way-merge-sort)
- [Validity of a given Tic-Tac-Toe board configuration](/validity-of-a-given-tic-tac-toe-board-configuration)
- [Weighted Prefix Search](/weighted-prefix-search)
- [Binary Tree to CDLL](/binary-tree-to-cdll)
- [Check if a Binary Tree is a Subtree of Another Binary Tree](/check-if-a-binary-tree-is-a-subtree-of-another-binary-tree)
- [Check if the Given String of Words can be Formed from Words Present in the Dictionary](/check-if-given-string-of-words-can-be-formed-from-words-present-in-dictionary)
- [Count sort vs bucket sort](/count-sort-vs-bucket-sort)
- [FIFO vs LIFO approach in Programming](/fifo-vslifo-approach-in-programming)
- [If you are given two traversal sequences, can you construct the binary tree](/if-you-are-given-two-traversal-sequences-can-you-construct-the-binary-tree)
- [Linked List Deletion (Deleting a key at a given position)](/linked-list-deletion)
- [Mastering Bracket Problems for Competitive Programming](/mastering-bracket-problems-for-competitive-programming)
- [Merge Overlapping Intervals](/merge-overlapping-intervals)
- [MIRROR OF MATRIX ACROSS DIAGONAL](/mirror-of-matrix-across-diagonal)
- [Pair of strings having longest common prefix of maximum length in given array](/pair-of-strings-having-longest-common-prefix-of-maximum-length-in-given-array)
- [Print all Possible Combinations of Words from the Dictionary using Trie](/print-all-possible-combinations-of-words-from-dictionary-using-trie)
- [Segment Tree (Range Maximum Query with Node Update)](/segment-tree)
- [Tree Vertex Splitting in data structure](/tree-vertex-splitting-in-data-structure)
- [Why is Binary Heap Preferred over BST for Priority Queue](/why-is-binary-heap-preferred-over-bst-for-priority-queue)
- [Arrange Consonants and Vowels in a linked list](/arrange-consonants-and-vowels-in-a-linked-list)
- [Copy a linked list with next and arbit pointer](/copy-a-linked-list-with-next-and-arbit-pointer)
- [Kahn's Algorithm vs DFS Approach: A Comparative Analysis](/kahns-algorithm-vs-dfs-approach)
- [Minimum flip required to make Binary Matrix symmetric](/minimum-flip-required-to-make-binary-matrix-symmetric)
- [Sorted insert for circular linked list](/sorted-insert-for-circular-linked-list)
- [C++ Program for Arranging Single Linked List in Alternate Odd and Even Nodes Order](/cpp-program-for-arranging-single-linked-list-in-alternate-odd-and-even-nodes-order)
- [Reservoir sampling in C++](/reservoir-sampling-in-cpp)
- [0/1 Knapsack using Least Cost Branch and Bound](/0-1-knapsack-using-least-cost-branch-and-bound)
- [Merge K Sorted Linked Lists using Min Heap](/merge-k-sorted-linked-lists-using-min-heap)
- [Number of elements greater than K in the range L to R using Fenwick Tree (Offline queries)](/number-of-elements-greater-than-k-in-the-range-l-to-r-using-fenwick-tree-offline-queries)
- [Detect Cycle in Graph using DSU](/detect-cycle-in-graph-using-dsu)
- [Merkle Tree and Hash Chain Data Structures with a difference](/merkle-tree-and-hash-chain-data-structures-with-a-difference)
- [Create a matrix with alternating rectangles of O and X](/create-a-matrix-with-alternating-rectangles-of-o-and-x)
- [Find the first non-repeating character from a stream of characters](/find-the-first-non-repeating-character-from-a-stream-of-characters)
- [Find the first circular tour that visits all petrol pumps](/find-the-first-circular-tour-that-visits-all-petrol-pumps)
- [Find the tasks completed by soldiers based on their ranks](/find-the-tasks-completed-by-soldiers-based-on-their-ranks)
- [K-th Largest Sum Contiguous Subarray](/k-th-largest-sum-contiguous-subarray)
- [Numbsubarrayer of elements less than or equal to a given number in a given](/numbsubarrayer-of-elements-less-than-or-equal-to-a-given-number-in-a-given)
- [Queries to add, remove and return the difference of maximum and minimum](/queries-to-add-remove-and-return-the-difference-of-maximum-and-minimum)
- [Time Complexity of building a heap](/time-complexity-of-building-a-heap)
- [Build linear type suffix](/build-linear-type-suffix)
- [Count of Valid Splits in a String](/count-of-valid-splits-in-a-string)
- [Delete all occurrences of a given key in a linked list](/delete-all-occurrences-of-a-given-key-in-a-linked-list)
- [Design a data structure that supports insert, delete, search and getRandom in constant time](/design-a-data-structure-that-supports-insert-delete-search-and-getrandom-in-cconstant-time)
- [Find the largest subarray with 0 sum](/find-the-largest-subarray-with-0-sum)
- [Free Tree in Data Structures](/free-tree-in-data-structures)
- [How to insert Strings into an AVL Tree](/how-to-insert-strings-into-an-avl-tree)
- [Longest Consecutive Subsequence](/longest-consecutive-subsequence)
- [Merge two binary Max Heaps](/merge-two-binary-max-heaps)
- [Secure Message Encoding](/secure-message-encoding)
- [Sort an almost sorted array](/sort-an-almost-sorted-array)
- [Tree of Space - Locking and Unlocking N-Ary Tree](/tree-of-space-locking-and-unlocking-n-ary-tree)
- [Triply Linked list](/triply-linked-list)
- [COUNT OF ZEROES](/count-of-zeroes)
- [Design a Chess Game](/design-a-chess-game)
- [Design a data structure that supports insert, delete, search and getRandom in constant time](/design-a-data-structure-that-supports-insert-delete-search-and-getrandom-in-constant-time)
- [Design and Implement Special Stack Data Structure](/design-and-implement-special-stack-data-structure)
- [Enhancing Password Strength](/enhancing-password-strength)
- [Enumeration of Binary Tree](/enumeration-of-binary-tree)
- [Eulerian and Hamiltonian path](/eulerian-and-hamiltonian-path)
- [Fair Array Removal Indices](/fair-array-removal-indices)
- [Find the Absolute Difference between the Right View Sum of two Binary Trees](/find-the-absolute-difference-between-the-right-view-sum-of-two-binary-trees)
- [Find the number of colored nodes according to given queries in a full Binary Tree](/find-the-number-of-colored-nodes-according-to-given-queries-in-a-full-binary-tree)
- [Finding Minimum Steps in Special Binary Tree](/finding-minimum-steps-in-special-binary-tree)
- [Finding the Largest Multiple of Three](/finding-the-largest-multiple-of-three)
- [Flatten a binary tree into linked list](/flatten-a-binary-tree-into-linked-list)
- [General Tree (Each node can have arbitrary number of children) Level Order Traversal](/general-tree-level-order-traversal)
- [Generating the Maximum Number from Two Arrays](/generating-the-maximum-number-from-two-arrays)
- [Hashing and its Applications](/hashing-and-its-applications)
- [Islands in a graph using BFS](/islands-in-a-graph-using-bfs)
- [Iterative Letter Combinations of a Phone Number](/iterative-letter-combinations-of-a-phone-number)
- [K-way Merge Sort](/k-way-merge-sort)
- [Maximize Total Score](/maximize-total-score)
- [PERMUTED ROWS IN A MATRIX](/permuted-rows-in-a-matrix)
- [Remove extra edge from a BST](/remove-extra-edge-from-a-bst)
- [Van Emde Boas Tree](/van-emde-boas-tree)
- [Which Minimum Spanning Tree Algorithm is better](/which-minimum-spanning-tree-algorithm-is-better)
- [Ackermann Function](/ackermann-function)
- [BINARY TO SYMMETRIX](/binary-to-symmetrix)
- [INPLACE MATRIX TRANSPOSE](/inplace-matrix-transpose)
- [Print all words matching a pattern in CamelCase Notation Dictionary](/print-all-words-matching-a-pattern-in-camelcase-notation-dictionary)
- [Reduce the string by removing K consecutive identical characters](/reduce-the-string-by-removing-k-consecutive-identical-characters)
- [Subtraction in Linked List](/subtraction-in-linked-list)
- [TRANSITIONS OF MATRIX](/transitions-of-matrix)
- [Blending vs Stacking](/blending-vs-stacking)
- [Bloom Filters](/bloom-filters)
- [Count Array Pairs Divisible by k](/count-array-pairs-divisible-by-k)
- [Counting Beautiful Numbers in a Specified Range](/counting-beautiful-numbers-in-a-specified-range)
- [Find the Closest Palindrome](/find-the-closest-palindrome)
- [Minimizing water collection distance in javaT village](/minimizing-water-collection-distance-in-javat-village)
- [Minimum Array Length After Pair Removals](/minimum-array-length-after-pair-removals)
- [Nth even Fibonacci Sequence](/nth-even-fibonacci-sequence)
- [Persistent Data Structure](/persistent-data-structure)
- [Queue for Competitive Programming](/queue-for-competitive-programming)
- [Recursively remove all adjacent duplicates](/recursively-remove-all-adjacent-duplicates)
- [Remove the letter to equalize the frequency](/remove-the-letter-to-equalize-the-frequency)
- [Chocolate Distribution Problem](/chocolate-distribution-problem)
- [Find out the person who got the ticket last problem in queue](/find-out-the-person-who-got-the-ticket-last-problem-in-queue)
- [Product Array Puzzle](/product-array-puzzle)
- [MCQs on backtracking](/mcq-on-backtracking)
- [Design a data structure that supports insert, delete, search, and getRandom in constant time](/design-a-data-structure-that-supports-insert-delete-search-and-getrandom-in-constant-time)
- [Assign directions to edges so that the directed graph remains acyclic](/assign-directions-to-edges-so-that-the-directed-graph-remains-acyclic)
- [Print the frequency of each character in Alphabetical order](/print-the-frequency-of-each-character-in-alphabetical-order)
- [Check if a queue can be sorted into another queue using a stack](/check-if-a-queue-can-be-sorted-into-another-queue-using-a-stack)
- [Auto-complete feature using Trie](/auto-complete-feature-using-trie)
- [Connect nodes at same level](/connect-nodes-at-same-level)
- [Construct Tree from Given Inorder and Preorder Traversals](/construct-tree-from-given-inorder-and-preorder-traversals)
- [Decimal Equivalent of Binary Linked List](/decimal-equivalent-of-binary-linked-list)
- [How do you implement Stack using Priority Queue or Heap](/how-do-you-implement-stack-using-priority-queue-or-heap)
- [Introduction to Monotonic Stacks](/introduction-to-monotonic-stacks)
- [Minimum Initial Points to Reach Destination](/minimum-initial-points-to-reach-destination)
- [Print Ancestors of a given node in Binary Tree](/print-ancestors-of-a-given-node-in-binary-tree)
- [Priority Queue using Doubly Linked List](/priority-queue-using-doubly-linked-list)
- [Shortest distance between two cells in a matrix or grid](/shortest-distance-between-two-cells-in-a-matrix-or-grid)
- [Sort an Array in Wave Form](/sort-an-array-in-wave-form)
- [Burn the binary tree starting from the target node](/burn-the-binary-tree-starting-from-the-target-node)
- [Check for possible paths in the 2D Matrix](/check-for-possible-paths-in-the-2d-matrix)
- [Find Triplets with zero-sum](/find-triplets-with-zero-sum)
- [Print a Given Matrix in Spiral form](/print-a-given-matrix-in-spiral-form)
- [Alien Dictionary problem in dsa](/alien-dictionary-problem-in-dsa)
- [Array Pair Sum Divisibility Problem](/array-pair-sum-divisibility-problem)
- [DIFFERENCE BETWEEN GREEDY AND DIVIDE AND CONQUER](/difference-between-greedy-and-divide-and-conquer)
- [How do you check if a given array represents a heap](/how-do-you-check-if-a-given-array-represents-a-heap)
- [LINKED LIST REVERSE](/linked-list-reverse)
- [MAXIMUM SIZE RECTANGLE](/maximum-size-rectangle)
- [Priority queue of pairs in C++ with ordering by first and second element](/priority-queue-of-pairs-in-cpp-with-ordering-by-first-and-second-element)
- [Reversing Individual Words and Unveiling the Secrets of Histograms](/reversing-individual-words-and-unveiling-the-secrets-of-histograms)
- [Sliding SubArray Beauty](/sliding-subarray-beauty)
- [Two Pointer Technique](/two-pointer-technique)
- [UGLY NUMBERS IN DSA](/ugly-numbers-in-dsa)
- [Check for Balanced Brackets in an expression](/check-for-balanced-brackets-in-an-expression)
- [Largest Number After Digit Swaps By Parity](/largest-number-after-digit-swaps-by-parity)
- [Minimize Deviation In Array](/minimize-deviation-in-array)
- [Print a given matrix in spiral form](/print-a-given-matrix-in-spiral-form)
- [Print unique rows in a given Boolean matrix](/print-unique-rows-in-a-given-boolean-matrix)
- [Restrictive Candy Crush](/restrictive-candy-crush)
- [Search in a row wise and column wise sorted matrix](/search-in-a-row-wise-and-column-wise-sorted-matrix)
- [SIP Stack](/sip-stack)
- [Stacked Bar Chart](/stacked-bar-chart)
- [Search Query Auto Complete](/search-query-auto-complete)
- [Applications of the greedy algorithm](/applications-of-the-greedy-algorithm)
- [Applications, Advantages and Disadvantages of Arrays](/applications-advantages-and-disadvantages-of-arrays)
- [Applications, Advantages and Disadvantages of Queue](/applications-advantages-and-disadvantages-of-queue)
- [Applications, Advantages and Disadvantages of Stacks](/applications-advantages-and-disadvantages-of-stacks)
- [Floor and Ceil from a BST](/floor-and-ceil-from-a-bst)
- [India Stack](/india-stack)
- [Next Higher Palindromic Numbers using the Same Set of Digits](/next-higher-palindromic-numbers-using-the-same-set-of-digits)
- [QuickSort on Singly Linked List](/quicksort-on-singly-linked-list)
- [Reverse a Number using Stacks](/reverse-a-number-using-stacks)
- [Serialize and Deserialize an N-ary Tree](/serialize-and-deserialize-an-n-ary-tree)
- [Stack Pointer](/stack-pointer)
- [What is a K-connected Graph](/what-is-a-k-connected-graph)
- [Append K Integers with Minimal Sum Problem](/append-k-integers-with-minimal-sum-problem)
- [Circular Linked Lists Introduction and Application](/circular-linked-lists-introduction-and-application)
- [Detect cycle in an undirected graph in C++](/detect-cycle-in-an-undirected-graph-in-cpp)
- [Detect Cycle in Graph using DSU](/detect-cycle-in-graph-using-dsu)
- [Find the maximum number of marked indices problem](/find-the-maximum-number-of-marked-indices-problem)
- [Generalized Suffix Tree](/generalized-suffix-tree)
- [Interval Tree](/interval-tree)
- [Maximum Number of Tasks Assignment Problem](/maximum-number-of-tasks-assignment-problem)
- [Merge K Sorted Lists](/merge-k-sorted-lists)
- [Triplet sum closest to given number](/triplet-sum-closest-to-given-number)
- [Apply Operations To Maximize Frequency Score](/apply-operations-to-maximize-frequency-score)
- [Difference between malloc and realloc](/difference-between-malloc-and-realloc)
- [Merge Sort on Singly Linked Lists](/merge-sort-on-singly-linked-lists)
- [Minimum Number Of Frogs Croaking](/minimum-number-of-frogs-croaking)
- [Total Distance Travelled](/total-distance-travelled)
- [X Of A Kind In A Deck Of Cards](/x-of-a-kind-in-a-deck-of-cards)
- [Applications, Advantages and Disadvantages of Linked List](/applications-advantages-and-disadvantages-of-linked-list)
- [Balls rolling in the maze](/balls-rolling-in-the-maze)
- [Destroy Sequential Targets](/destroy-sequential-targets)
- [Difference Between Push and Pop in Stack](/difference-between-push-and-pop-in-stack)
- [Dynamic Programming (DP) on Grids](/dynamic-programming-on-grids)
- [Find all good strings problem in Data Structure](/find-all-good-strings-problem-in-data-structure)
- [Find Itinerary from a given list of tickets](/find-itinerary-from-a-given-list-of-tickets)
- [Height of n-ary tree if parent array is given](/height-of-n-ary-tree-if-parent-array-is-given)
- [Maximum Deletions on a String](/maximum-deletions-on-a-string)
- [Reversal algorithm for Array rotation](/reversal-algorithm-for-array-rotation)
- [Reverse Pairs Problem in Data Structure](/reverse-pairs-problem-in-data-structure)
- [String Hashing using the Polynomial Rolling Hash Function](/string-hashing-using-the-polynomial-rolling-hash-function)
- [The Great Tree-List Recursion Problem](/the-great-tree-list-recursion-problem)
- [Trapping of rainwater problem in Data Structure](/trapping-of-rainwater-problem-in-data-structure)
- [What Does Big O(N^2) Complexity Mean](/what-does-big-o-n-2-complexity-mean)
- [How to handle duplicates in Binary Search Tree](/how-to-handle-duplicates-in-binary-search-tree)
- [Optimal cell in matrix to collect maximum coins](/optimal-cell-in-matrix-to-collect-maximum-coins)
- [Maximizing Chocolates in Grid using 2 robots](/maximizing-chocolates-in-grid-using-2-robots)
- [Create a matrix with alternating rectangles of O and X](/create-a-matrix-with-alternating-rectangles-of-o-and-x)
- [Interleave the first half of the queue with the second half](/interleave-the-first-half-of-the-queue-with-the-second-half)
- [The sum of all elements between k1'th and k2'th smallest elements](/the-sum-of-all-elements-between-k1th-and-k2th-smallest-elements)
- [Binary Indexed Tree Range Updates and Point Queries](/binary-indexed-tree-range-updates-and-point-queries)
- [Burn the binary tree starting from the target node](/burn-the-binary-tree-starting-from-the-target-node)
- [Check Matrix Transformation by Flipping Sub-Matrices along the Principal or Anti-Diagonal](/check-matrix-transformation-by-flipping-sub-matrices-along-the-principal-or-anti-diagonal)
- [DFS for an n-ary Tree(Acyclic Graph) Represented as an Adjacency List](/dfs-for-an-n-ary-tree-represented-as-an-adjacency-list)
- [Difference Between Counting Sort and Bucket Sort](/difference-between-counting-sort-and-bucket-sort)
- [Internal Data Structures and Time Complexity Table of All the C++ STL Containers](/internal-data-structures-and-time-complexity-table-of-all-the-cpp-stl-containers)
- [K Centres Problem (Greedy Approximate Algorithm)](/k-centres-problem-greedy-approximate-algorithm)
- [Left Rotation and Right Rotation of a String](/left-rotation-and-right-rotation-of-a-string)
- [Merge Two Sorted Linked Lists](/merge-two-sorted-linked-lists)
- [Move all Zeroes to End of Array](/move-all-zeroes-to-end-of-array)
- [Number of flips to make binary string alternate](/number-of-flips-to-make-binary-string-alternate)
- [Program to Reveal the Positions in Minesweeper](/program-to-reveal-the-positions-in-minesweeper)
- [Tarjan's Algorithm to Find Strongly Connected Components](/tarjans-algorithm-to-find-strongly-connected-components)
- [Difference between big o and big theta ? and big omega ? notations](/difference-between-big-o-and-big-theta-and-big-omega-notations)

## DS MCQ

- [Data Structure MCQ](/data-structure-mcq)
- [Advanced DS MCQ](/advanced-data-structure-mcq)

## Singly Linked List

- [Insertion at beginning](/insertion-in-singly-linked-list-at-beginning)
- [Insertion at end](/insertion-in-singly-linked-list-at-end)
- [Insertion after specified node](/insertion-in-singly-linked-list-after-specified-node)
- [Deletion at beginning](/deletion-in-singly-linked-list-at-beginning)
- [Deletion at end](/deletion-in-singly-linked-list-at-end)
- [Deletion after specified node](/deletion-in-singly-linked-list-after-specified-node)
- [Traversing](/traversing-in-singly-linked-list)
- [Searching](/searching-in-singly-linked-list)

## Doubly Linked List

- [Insertion at beginning](/insertion-in-doubly-linked-list-at-beginning)
- [Insertion at end](/insertion-in-doubly-linked-list-at-the-end)
- [Insertion after specified node](/insertion-in-doubly-linked-list-after-specified-node)
- [Deletion at beginning](/deletion-in-doubly-linked-list-at-beginning)
- [Deletion at end](/deletion-in-doubly-linked-list-at-the-end)
- [Deletion of node having given data](/deletion-in-doubly-linked-list-after-the-specified-node)
- [Traversing](/traversing-in-doubly-linked-list)
- [Searching](/searching-in-doubly-linked-list)

## Circular Linked List

- [Insertion at beginning](/insertion-in-circular-singly-list-at-beginning)
- [Insertion at end](/insertion-in-circular-singly-linked-list-at-end)
- [Deletion at beginning](/deletion-in-circular-singly-linked-list-at-beginning)
- [Deletion at the end](/deletion-in-circular-singly-linked-list-at-end)

## Circular Doubly List

- [Insertion at beginning](/insertion-in-circular-doubly-linked-list-at-beginning)
- [Insertion at end](/insertion-in-circular-doubly-linked-list-at-end)
- [Deletion at beginning](/deletion-in-circular-doubly-linked-list-at-beginning)
- [Deletion at the end](/deletion-in-circular-doubly-linked-list-at-end)

## Binary Tree

- [Pre-order Traversal](/binary-tree-preorder-traversal)
- [In-order Traversal](/binary-tree-inorder-traversal)
- [Post-order Traversal](/binary-tree-postorder-traversal)

## Binary Search Tree

- [Searching in BST](/searching-in-binary-search-tree)
- [Insertion in BST](/insertion-in-binary-search-tree)
- [Deletion in BST](/deletion-in-binary-search-tree)

## AVL Tree

- [Insertion in AVL Tree](/insertion-in-avl-tree)
- [a)LL Rotation](/ll-rotation-in-avl-tree)
- [b)LR Rotation](/lr-rotation-in-avl-tree)
- [c)RL Rotation](/rl-rotation-in-avl-tree)
- [d)RR Rotation](/rr-rotation-in-avl-tree)
- [Deletion in AVL Tree](/deletion-in-avl-tree)

[next →](data-structure-introduction)

# Data Structures Tutorial

![DS Tutorial](https://static.javatpoint.com/ds/images/ds-tutorial.png)

Data Structures (DS) tutorial provides basic and advanced concepts of Data Structure. Our Data Structure tutorial is designed for beginners and professionals.

Data Structure is a way to store and organize data so that it can be used efficiently.

Our Data Structure tutorial includes all topics of Data Structure such as Array, Pointer, Structure, Linked List, Stack, Queue, Graph, Searching, Sorting, Programs, etc.

### What is Data Structure?

The data structure name indicates itself that organizing the data in memory. There are many ways of organizing the data in the memory as we have already seen one of the data structures, i.e., array in C language. Array is a collection of memory elements in which data is stored sequentially, i.e., one after another. In other words, we can say that array stores the elements in a continuous manner. This organization of data is done with the help of an array of data structures. There are also other ways to organize the data in memory. Let's see the different types of data structures.

The data structure is not any programming language like C, C++, java, etc. It is a set of algorithms that we can use in any programming language to structure the data in the memory.

To structure the data in memory, 'n' number of algorithms were proposed, and all these algorithms are known as Abstract data types. These abstract data types are the set of rules.

![Data Structures Tutorial](https://static.javatpoint.com/ds/images/data-structure-tutorial2.png)

### Types of Data Structures

There are two types of data structures:

- Primitive data structure
- Non-primitive data structure

**Primitive Data structure**

The primitive data structures are primitive data types. The int, char, float, double, and pointer are the primitive data structures that can hold a single value.

**Non-Primitive Data structure**

The non-primitive data structure is divided into two types:

- Linear data structure
- Non-linear data structure

**Linear Data Structure**

The arrangement of data in a sequential manner is known as a linear data structure. The data structures used for this purpose are Arrays, Linked list, Stacks, and Queues. In these data structures, one element is connected to only one another element in a linear form.

**When one element is connected to the 'n' number of elements known as a non-linear data structure. The best example is trees and graphs. In this case, the elements are arranged in a random manner.**

We will discuss the above data structures in brief in the coming topics. Now, we will see the common operations that we can perform on these data structures.

**Data structures can also be classified as:**

- **Static data structure:** It is a type of data structure where the size is allocated at the compile time. Therefore, the maximum size is fixed.
- **Dynamic data structure:** It is a type of data structure where the size is allocated at the run time. Therefore, the maximum size is flexible.

### Major Operations

The major or the common operations that can be performed on the data structures are:

- **Searching:** We can search for any element in a data structure.
- **Sorting:** We can sort the elements of a data structure either in an ascending or descending order.
- **Insertion:** We can also insert the new element in a data structure.
- **Updation:** We can also update the element, i.e., we can replace the element with another element.
- **Deletion:** We can also perform the delete operation to remove the element from the data structure.

### Which Data Structure?

A data structure is a way of organizing the data so that it can be used efficiently. Here, we have used the word efficiently, which in terms of both the space and time. For example, a stack is an ADT (Abstract data type) which uses either arrays or linked list data structure for the implementation. Therefore, we conclude that we require some data structure to implement a particular ADT.

An ADT tells **what** is to be done and data structure tells **how** it is to be done. In other words, we can say that ADT gives us the blueprint while data structure provides the implementation part. Now the question arises: how can one get to know which data structure to be used for a particular ADT?.

As the different data structures can be implemented in a particular ADT, but the different implementations are compared for time and space. For example, the Stack ADT can be implemented by both Arrays and linked list. Suppose the array is providing time efficiency while the linked list is providing space efficiency, so the one which is the best suited for the current user's requirements will be selected.

### Advantages of Data structures

**The following are the advantages of a data structure:**

- **Efficiency:** If the choice of a data structure for implementing a particular ADT is proper, it makes the program very efficient in terms of time and space.
- **Reusability:** The data structure provides reusability means that multiple client programs can use the data structure.
- **Abstraction:** The data structure specified by an ADT also provides the level of abstraction. The client cannot see the internal working of the data structure, so it does not have to worry about the implementation part. The client can only see the interface.

* * *

## Data Structures Index

* * *

**DS Basics**

- [DS Tutorial](data-structure-tutorial)
- [DS Introduction](data-structure-introduction)
- [DS Algorithm](data-structure-algorithm)
- [Ds Asymptotic Analysis](data-structure-asymptotic-analysis)
- [DS Pointer](data-structure-pointer)
- [DS Structure](data-structure-structure)

**DS Array**

- [Array](data-structure-array)
- [2D Array](data-structure-2d-array)

**DS Linked List**

- [Linked List](singly-linked-list)
  - [Insertion at beginning](insertion-in-singly-linked-list-at-beginning)
  - [Insertion at end](insertion-in-singly-linked-list-at-end)
  - [Insertion after specified node](insertion-in-singly-linked-list-after-specified-node)
  - [Deletion at beginning](deletion-in-singly-linked-list-at-beginning)
  - [Deletion at end](deletion-in-singly-linked-list-at-end)
  - [Deletion after specified node](deletion-in-singly-linked-list-after-specified-node)
  - [Traversing](traversing-in-singly-linked-list)
  - [Searching](searching-in-singly-linked-list)
- [Doubly Linked List](doubly-linked-list)
  - [Insertion at beginning](insertion-in-doubly-linked-list-at-beginning)
  - [Insertion at end](insertion-in-doubly-linked-list-at-the-end)
  - [Insertion after specified node](insertion-in-doubly-linked-list-after-specified-node)
  - [Deletion at beginning](deletion-in-doubly-linked-list-at-beginning)
  - [Deletion at end](deletion-in-doubly-linked-list-at-the-end)
  - [Deletion of node having given data](deletion-in-doubly-linked-list-after-the-specified-node)
  - [Traversing](traversing-in-doubly-linked-list)
  - [Searching](searching-in-doubly-linked-list)
- [Circular Linked List](circular-singly-linked-list)
  - [Insertion at beginning](insertion-in-circular-singly-list-at-beginning)
  - [Insertion at end](insertion-in-circular-singly-linked-list-at-end)
  - [Deletion at beginning](deletion-in-circular-singly-linked-list-at-beginning)
  - [Deletion at the end](deletion-in-circular-singly-linked-list-at-end)
  - [Traversing](deletion-in-circular-singly-linked-list-at-end)
  - [Searching](deletion-in-circular-singly-linked-list-at-end)
- [Circular Doubly List](circular-doubly-linked-list)
  - [Insertion at beginning](insertion-in-circular-doubly-linked-list-at-beginning)
  - [Insertion at end](insertion-in-circular-doubly-linked-list-at-end)
  - [Deletion at beginning](deletion-in-circular-doubly-linked-list-at-beginning)
  - [Deletion at the end](deletion-in-circular-doubly-linked-list-at-end)

**DS Stack**

- [DS Stack](data-structure-stack)
- [Array Implementation](ds-array-implementation-of-stack)
- [Linked List Implementation](ds-linked-list-implementation-of-stack)

**DS Queue**

- [DS Queue](data-structure-queue)
- [Array Implementation](array-representation-of-queue)
- [Linked List Implementation](linked-list-implementation-of-queue)
- [Circular Queue](circular-queue)

**DS Tree**

- [Tree](tree)
- [Binary Tree](binary-tree)
  - [Pre-order Traversal](binary-tree-preorder-traversal)
  - [In-order Traversal](binary-tree-inorder-traversal)
  - [Post-order Traversal](binary-tree-postorder-traversal)
- [Binary Search Tree](binary-search-tree)
  - [Searching in BST](searching-in-binary-search-tree)
  - [Insertion in BST](insertion-in-binary-search-tree)
  - [Deletion in BST](deletion-in-binary-search-tree)
- [AVL Tree](avl-tree)

  - [Insertion in AVL Tree](insertion-in-avl-tree)
    - [LL Rotation](ll-rotation-in-avl-tree)
    - [LR Rotation](lr-rotation-in-avl-tree)
    - [RL Rotation](rl-rotation-in-avl-tree)
    - [RR Rotation](rr-rotation-in-avl-tree)

  - [Deletion in AVL Tree](deletion-in-avl-tree)
- [B Tree](b-tree)
- [B+ Tree](b-plus-tree)
- [Red Black Tree](red-black-tree)

**DS Graph**

- [DS Graph](ds-graph)
- [Graph Implementation](graph-representation)
- [BFS Algorithm](breadth-first-search-algorithm)
- [DFS Algorithm](depth-first-search-algorithm)
- [Spanning Tree](spanning-tree)
  - [Prim's Algorithm](prim-algorithm)
  - [Kruskal's Algorithm](kruskal-algorithm)

**DS Searching**

- [Linear Search](linear-search)
- [Binary Search](binary-search)

**DS Sorting**

- [Bubble Sort](bubble-sort)
- [Bucket Sort](bucket-sort)
- [Comb Sort](comb-sort)
- [Counting Sort](counting-sort)
- [Heap Sort](heap-sort)
- [Insertion Sort](insertion-sort)
- [Merge Sort](merge-sort)
- [Quick Sort](quick-sort)
- [Radix Sort](radix-sort)
- [Selection Sort](selection-sort)
- [Shell Sort](shell-sort)
- [Bitonic Sort](bitonic-sort)
- [Cocktail Sort](cocktail-sort)
- [Cycle Sort](cycle-sort)
- [Tim Sort](tim-sort)

**Interview Questions**

- [DS Interview Questions](data-structure-interview-questions)

**Singly Linked List Programs**

- [Program to create and display a singly linked list](program-to-create-and-display-a-singly-linked-list)
- [Program to create a singly linked list of n nodes and count the number of nodes](program-to-create-a-singly-linked-list-of-n-nodes-and-count-the-number-of-nodes)
- [Program to create a singly linked list of n nodes and display it in reverse order](program-to-create-a-singly-linked-list-of-n-nodes-and-display-it-in-reverse-order)
- [Program to delete a new node from the beginning of the singly linked list](program-to-delete-a-new-node-from-the-beginning-of-the-singly-linked-list)
- [Program to delete a new node from the middle of the singly linked list](program-to-delete-a-new-node-from-the-middle-of-the-singly-linked-list)
- [Program to delete a node from the end of the singly linked list](program-to-delete-a-node-from-the-end-of-the-singly-linked-list)
- [Program to determine whether a singly linked list is the palindrome](program-to-determine-whether-a-singly-linked-list-is-the-palindrome)
- [Program to find the maximum and minimum value node from a singly linked list](program-to-find-the-maximum-and-minimum-value-node-from-a-singly-linked-list)
- [Program to insert a new node at the middle of the singly linked list](program-to-insert-a-new-node-at-the-middle-of-the-singly-linked-list)
- [Program to insert a new node at the beginning of the singly linked list](program-to-insert-a-new-node-at-the-beginning-of-the-singly-linked-list)
- [Program to insert a new node at the end of the singly linked list](program-to-insert-a-new-node-at-the-end-of-the-singly-linked-list)
- [Program to remove duplicate elements from a singly linked list](program-to-remove-duplicate-elements-from-a-singly-linked-list)
- [Program to search an element in a singly linked list](program-to-search-an-element-in-a-singly-linked-list)
- [Program to sort the elements of the singly linked list](program-to-sort-the-elements-of-the-singly-linked-list)
- [Program to swap nodes in a singly linked list without swapping data](program-to-swap-nodes-in-a-singly-linked-list-without-swapping-data)
- [Program to swap the last element of the singly linked list from the first one](program-to-swap-the-last-element-of-the-singly-linked-list-from-the-first-one)

**Doubly Linked List Programs**

- [Program to Convert a Given Binary Tree to Doubly Linked List](program-to-convert-a-given-binary-tree-to-doubly-linked-list)
- [Program to Create a Doubly Linked List From a Ternary Tree](program-to-create-a-doubly-linked-list-from-a-ternary-tree)
- [Program to Create a Doubly Linked List of N Nodes and Count the Number of Nodes](program-to-create-a-doubly-linked-list-of-n-nodes-and-count-the-number-of-nodes)
- [Program to Create a Doubly Linked List of N Nodes and Display it in Reverse Order](program-to-create-a-doubly-linked-list-of-n-nodes-and-display-it-in-reverse-order)
- [Program to Create and Display a Doubly Linked List](program-to-create-and-display-a-doubly-linked-list)
- [Program to Delete a New Node From the Beginning of the Doubly Linked List](program-to-delete-a-new-node-from-the-beginning-of-the-doubly-linked-list)
- [Program to Delete a New Node From the End of the Doubly Linked List](program-to-delete-a-new-node-from-the-end-of-the-doubly-linked-list)
- [Program to Delete a New Node From the Middle of the Doubly Linked List](program-to-delete-a-new-node-from-the-middle-of-the-doubly-linked-list)
- [Program to Find the Maximum and Minimum Value Node From a Doubly Linked List](program-to-find-the-maximum-and-minimum-value-node-from-a-doubly-linked-list)
- [Program to Insert a New Node at the Beginning of the Doubly Linked List](program-to-insert-a-new-node-at-the-beginning-of-the-doubly-linked-list)
- [Program to Insert a New Node at the End of Doubly Linked List](program-to-insert-a-new-node-at-the-end-of-doubly-linked-list)
- [Program to Insert a New Node at the Middle of Doubly Linked List](program-to-insert-a-new-node-at-the-middle-of-doubly-linked-list)
- [Program to Remove Duplicate Elements From a Doubly Linked List](program-to-remove-duplicate-elements-from-a-doubly-linked-list)
- [Program to Rotate Doubly Linked List by N Nodes](program-to-rotate-doubly-linked-list-by-n-nodes)
- [Program to Search an Element in a Doubly Linked List](program-to-search-an-element-in-a-doubly-linked-list)
- [Program to Sort the Elements of the Doubly Linked List](program-to-sort-the-elements-of-the-doubly-linked-list)

**Circular Linked List Programs**

- [Program to Create a Circular Linked List of N Nodes and Count the Number of Nodes](program-to-create-a-circular-linked-list-of-n-nodes-and-count-the-number-of-nodes)
- [Program to Create a Circular Linked List of N Nodes and Display it in Reverse Order](program-to-create-a-circular-linked-list-of-n-nodes-and-display-it-in-reverse-order)
- [Program to Create and Display a Circular Linked List](program-to-create-and-display-a-circular-linked-list)
- [Program to Delete a New Node From the Beginning of the Circular Linked List](program-to-delete-a-new-node-from-the-beginning-of-the-circular-linked-list)
- [Program to Delete a New Node From the End of the Circular Linked List](program-to-delete-a-new-node-from-the-end-of-the-circular-linked-list)
- [Program to Delete a New Node From the Middle of the Circular Linked List](program-to-delete-a-new-node-from-the-middle-of-the-circular-linked-list)
- [Program to Find the Maximum and Minimum Value Node From a Circular Linked List](program-to-find-the-maximum-and-minimum-value-node-from-a-circular-linked-list)
- [Program to Insert a New Node at the Beginning of the Circular Linked List](program-to-insert-a-new-node-at-the-beginning-of-the-circular-linked-list)
- [Program to Insert a New Node at the End of the Circular Linked List](program-to-insert-a-new-node-at-the-end-of-the-circular-linked-list)
- [Program to Insert a New Node at the Middle of the Circular Linked List](program-to-insert-a-new-node-at-the-middle-of-the-circular-linked-list)
- [Program to Remove Duplicate Elements From a Circular Linked List](program-to-remove-duplicate-elements-from-a-circular-linked-list)
- [Program to Search an Element in a Circular Linked List](program-to-search-an-element-in-a-circular-linked-list)
- [Program to Sort the Elements of the Circular Linked List](program-to-sort-the-elements-of-the-circular-linked-list)

**Tree Programs**

- [Program to Calculate the Difference Between the Sum of the Odd Level and Even Level Nodes of a Binary Tree](program-to-calculate-the-difference-between-the-sum-of-the-odd-level-and-even-level-nodes-of-a-binary-tree)
- [Program to Construct a Binary Search Tree and Perform Deletion and Inorder Traversal](program-to-construct-a-binary-search-tree-and-perform-deletion-and-inorder-traversal)
- [Program to Convert Binary Tree to Binary Search Tree](program-to-convert-binary-tree-to-binary-search-tree)
- [Program to Determine Whether all Leaves are at Same Level](program-to-determine-whether-all-leaves-are-at-same-level)
- [Program to Determine Whether two Trees are Identical](program-to-determine-whether-two-trees-are-identical)
- [Program to Find Maximum Width of a Binary Tree](program-to-find-maximum-width-of-a-binary-tree)
- [Program to Find the Largest Element in a Binary Tree](program-to-find-the-largest-element-in-a-binary-tree)
- [Program to Find the Maximum Depth or Height of a Tree](program-to-find-the-maximum-depth-or-height-of-a-tree)
- [Program to Find the Nodes Which are at the Maximum Distance in a Binary Tree](program-to-find-the-nodes-which-are-at-the-maximum-distance-in-a-binary-tree)
- [Program to Find the Smallest Element in a Binary Tree](program-to-find-the-smallest-element-in-a-binary-tree)
- [Program to Find the Sum of all the Nodes of a Binary Tree](program-to-find-the-sum-of-all-the-nodes-of-a-binary-tree)
- [Program to Find the Total Number of Possible Binary Search Trees with N Keys](program-to-find-the-total-number-of-possible-binary-search-trees-with-n-keys)
- [Program to Implement Binary Tree using the Linked List](program-to-implement-binary-tree-using-the-linked-list)
- [Program to Search a Node in a Binary Tree](program-to-search-a-node-in-a-binary-tree)

* * *

## Prerequisite

Before learning Data Structure, you must have the basic knowledge of C.

## Audience

Our Data Structure tutorial is designed to help beginners and professionals.

## Problem

We assure that you will not find any problem in this Data Structure tutorial. But if there is any mistake, please post it in the contact form.

* * *

Next Topic[Data Structure Introduction](data-structure-introduction)

[next →](data-structure-introduction)

## Latest Courses

[![Python](/static/img/python.png)](/python-tutorial)

[![Java](/static/img/java.png)](/java-tutorial)

[![Javascript](/static/img/js.png)](/javascript-tutorial)

[![Html](/static/img/html-5.png)](/html-tutorial)

[![Database](/static/img/database.png)](/sql-create-database)

[![Php](/static/img/php.png)](/php-tutorial)

[![C++](/static/img/c-.png)](/cpp-tutorial)

[![React](/static/img/react.png)](/reactjs-tutorial)

[![Data-Structures](/static/img/data-structures.png)](/data-structure-tutorial)

[![Cloud-Computing](/static/img/cloud-computing.png)](/cloud-computing)

[![Ethical-Hacking](/static/img/ethical-hacking.png)](/ethical-hacking)

![Logo](/static/img/logo.png)

We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks

##### Contact info

G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India

[\[email protected\]](/cdn-cgi/l/email-protection).

##### Follow us

[![Facebook](/static/img/facebook.png)](https://www.facebook.com/javatpoint)[![Twitter](/static/img/twitter.png)](https://twitter.com/pagejavatpoint)![Rss](/static/img/rss.png)[![Blogspot](/static/img/jp.png)](https://javatpoint.blogspot.com)[![Youtube](/static/img/youtube.png)](https://www.youtube.com/channel/UCUnYvQVCrJoFWZhKK3O2xLg)

##### Tutorials

[Java](/java-tutorial) [Data Structures](/data-structure-tutorial) [C Programming](/c-programming-language-tutorial) [C++ Tutorial](/cpp-tutorial) [C# Tutorial](/c-sharp-tutorial) [PHP Tutorial](/php-tutorial) [HTML Tutorial](/html-tutorial) [JavaScript Tutorial](/javascript-tutorial) [jQuery Tutorial](/jquery-tutorial) [Spring Tutorial](/spring-tutorial)

##### Interview Questions

[Tcs](/tcs-interview-questions) [Intuit](/intuit-interview-questions) [Wipro](/wipro-interview-questions) [Adobe](/adobe-interview-questions) [Infosys](/infosys-interview-questions) [Amazon](/amazon-interview-questions) [Accenture](/accenture-interview-questions) [Cognizant](/cognizant-interview-questions) [Capgemini](/capgemini-interview-questions) [Microsoft](/microsoft-interview-questions)

##### Online Compiler

[C](/compiler/c) [R](/compiler/r) [C++](/compiler/c++) [Php](/compiler/php) [Java](/compiler/java) [Html](/compiler/html) [Swift](/compiler/swift) [Python](/compiler/python) [JavaScript](/compiler/javascript) [TypeScript](/compiler/typescript)

© Copyright 2024 Javatpoint. All Rights Reserved.