# Data Structures – GeeksforGeeks

Practice Problems on all Data Structures
Recent articles on Data Structures
Some Quizzes on Data Structures

## What is Data Structure:

A data structure is a storage that is used to store and organize data. It is a way of arranging data on a computer so that it can be accessed and updated efficiently.

A data structure is not only used for organizing the data. It is also used for processing, retrieving, and storing data. There are different basic and advanced types of data structures that are used in almost every program or software system that has been developed. So we must have good knowledge about data structures.

## Classification of Data Structure:

Classification of Data Structure

• Linear data structure: Data structure in which data elements are arranged sequentially or linearly, where each element is attached to its previous and next adjacent elements, is called a linear data structure.
Examples of linear data structures are array, stack, queue, linked list, etc.
• Static data structure: Static data structure has a fixed memory size. It is easier to access the elements in a static data structure.
An example of this data structure is an array.
• Dynamic data structure: In dynamic data structure, the size is not fixed. It can be randomly updated during the runtime which may be considered efficient concerning the memory (space) complexity of the code.
Examples of this data structure are queue, stack, etc.
• Non-linear data structure: Data structures where data elements are not placed sequentially or linearly are called non-linear data structures. In a non-linear data structure, we can’t traverse all the elements in a single run only.
Examples of non-linear data structures are trees and graphs.

For example, we can store a list of items having the same data-type using the array data structure.

Array Data Structure

This page contains detailed tutorials on different data structures (DS) with topic-wise problems.

Introduction to Data Structures:

Popular types of Data Structures:

Overview:

1. Circular Linked List Introduction and Applications,
2. Circular Singly Linked List Insertion<
4. Split a Circular Linked List into two halves
5. Sorted insert for circular linked list

1. Doubly Linked List Introduction and Insertion
2. Delete a node in a Doubly Linked List
3. Reverse a Doubly Linked List
4. The Great Tree-List Recursion Problem.
5. QuickSort on Doubly Linked List
6. Merge Sort for Doubly Linked List

Stack:

1. Introduction to Stack
2. Infix to Postfix Conversion using Stack
3. Evaluation of Postfix Expression
4. Reverse a String using Stack
5. Implement two stacks in an array
6. Check for balanced parentheses in an expression
7. Next Greater Element
8. Reverse a stack using recursion
9. Sort a stack using recursion
10. The Stock Span Problem
11. Design and Implement Special Stack Data Structure
12. Implement Stack using Queues
13. Design a stack with operations on middle element
14. How to efficiently implement k stacks in a single array?
15. Sort a stack using recursion

Quiz on Stack
All Articles on Stack
Coding Practice on Stack
Recent Articles on Stack

Queue:

Quiz on Queue
All Articles on Queue
Coding Practice on Queue
Recent Articles on Queue

Binary Tree:

Quiz on Binary Tree
Quiz on Binary Tree Traversals
All articles on Binary Tree
Coding Practice on Binary Tree
Recent Articles on Tree

Binary Search Tree:

Quiz on Binary Search Trees
Quiz on Balanced Binary Search Trees
All Articles on Binary Search Tree
Coding Practice on Binary Search Tree
Recent Articles on BST

Heap:

All Articles on Heap
Quiz on Heap
Coding Practice on Heap
Recent Articles on Heap

Hashing:

Quiz on Hashing
All Articles on Hashing
Coding Practice on Hashing
Recent Articles on Hashing

Graph:

Introduction, DFS and BFS:

Segment Tree:

1. Segment Tree | Set 1 (Sum of given range)
2. Segment Tree | Set 2 (Range Minimum Query)
3. Lazy Propagation in Segment Tree
4. Persistent Segment Tree | Set 1 (Introduction)

All articles on Segment Tree
Trie:

1. Trie | (Insert and Search)
2. Trie | (Delete)
3. Longest prefix matching – A Trie based solution in Java
4. Print unique rows in a given boolean matrix
5. How to Implement Reverse DNS Look Up Cache?
6. How to Implement Forward DNS Look Up Cache?

All Articles on Trie
Binary Indexed Tree:

1. Binary Indexed Tree
2. Two Dimensional Binary Indexed Tree or Fenwick Tree
3. Binary Indexed Tree : Range Updates and Point Queries
4. Binary Indexed Tree : Range Update and Range Queries

All Articles on Binary Indexed Tree
Suffix Array and Suffix Tree:

1. Suffix Array Introduction
2. Suffix Array nLogn Algorithm
3. kasai’s Algorithm for Construction of LCP array from Suffix Array
4. Suffix Tree Introduction
5. Ukkonen’s Suffix Tree Construction – Part 1
6. Ukkonen’s Suffix Tree Construction – Part 2
7. Ukkonen’s Suffix Tree Construction – Part 3
8. Ukkonen’s Suffix Tree Construction – Part 4,
9. Ukkonen’s Suffix Tree Construction – Part 5
10. Ukkonen’s Suffix Tree Construction – Part 6
11. Generalized Suffix Tree
12. Build Linear Time Suffix Array using Suffix Tree
13. Substring Check
14. Searching All Patterns
15. Longest Repeated Substring,
16. Longest Common Substring, Longest Palindromic Substring

All Articles on Suffix Tree

AVL Tree:

1. AVL Tree | Set 1 (Insertion)
2. AVL Tree | Set 2 (Deletion)
3. AVL with duplicate keys

Splay Tree:

1. Splay Tree | Set 1 (Search)
2. Splay Tree | Set 2 (Insert)

B Tree:

1. B-Tree | Set 1 (Introduction)
2. B-Tree | Set 2 (Insert)
3. B-Tree | Set 3 (Delete)

Red-Black Tree:

1. Red-Black Tree Introduction
2. Red Black Tree Insertion.
3. Red-Black Tree Deletion
4. Program for Red Black Tree Insertion

All Articles on Self-Balancing BSTs

K Dimensional Tree:

1. KD Tree (Search and Insert)
2. K D Tree (Find Minimum)
3. K D Tree (Delete)

Others:

1. Treap (A Randomized Binary Search Tree)
2. Ternary Search Tree
3. Interval Tree
4. Implement LRU Cache
5. Sort numbers stored on different machines
6. Find the k most frequent words from a file
7. Given a sequence of words, print all anagrams together
8. Tournament Tree (Winner Tree) and Binary Heap
9. Decision Trees – Fake (Counterfeit) Coin Puzzle (12 Coin Puzzle)
10. Spaghetti Stack
11. Data Structure for Dictionary and Spell Checker?
12. Cartesian Tree
13. Cartesian Tree Sorting
14. Sparse Set
15. Centroid Decomposition of Tree
16. Gomory-Hu Tree

Recent Articles on Advanced Data Structures.

Array:

All Articles on Array
Coding Practice on Array
Quiz on Array
Coding Practice on Array
Recent Articles on Array

Matrix:

All Articles on Matrix
Coding Practice on Matrix
Recent Articles on Matrix.

Misc:

### GeeksforGeeks Courses

We are offering free coding tuts

X