Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • GfG 160: Daily DSA
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Python Tutorial
  • Interview Questions
  • Python Quiz
  • Python Glossary
  • Python Projects
  • Practice Python
  • Data Science With Python
  • Python Web Dev
  • DSA with Python
  • Python OOPs
Open In App
Next Article:
Data Structures and Algorithms (DSA) MCQ Quiz Online
Next article icon

Learn DSA with Python | Python Data Structures and Algorithms

Last Updated : 08 Mar, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

This tutorial is a beginner-friendly guide for learning data structures and algorithms using Python. In this article, we will discuss the in-built data structures such as lists, tuples, dictionaries, etc. and some user-defined data structures such as linked lists, trees, graphs, etc.

1. List

List is a built-in dynamic array which can store elements of different data types. It is an ordered collection of item, that is elements are stored in the same order as they were inserted into the list. List stores references to the objects (elements) rather than storing the actual data itself.

Python List Example:

Python
a = [10, 20, "GfG", 40, True]
print(a)

Output
[10, 20, 'GfG', 40, True]
python-list

Related Posts:

  • Python Lists Guide
  • Python Lists Quiz
  • Python List Exercise

Recommended DSA Problems:

  • Print Alternates in List
  • Search in a List
  • Largest Element
  • Reverse List
  • Check for Sorted List

To solve more DSA Problems based on List, refer Python List DSA Problems.

2. Searching Algorithms

Searching algorithms are used to locate a specific element within a data structure, such as an array, list, or tree. They are used for efficiently retrieving information in large datasets.

Related Posts:

  • Searching Algorithms in Python Guide
  • Quiz on Searching

Recommended DSA Problems:

  • Second Largest in an Array
  • First Repeating Element
  • Count Zeros in Sorted Binary Array
  • Floor in a Sorted Array
  • Maximum in Bitonic Array

3. Sorting Algorithms

Sorting algorithms are used to arrange the elements of a data structure, such as an array, list, or tree, in a particular order, typically in ascending or descending order. These algorithms are used for organizing data, which enables more efficient searching, merging, and other operations.

Related Posts:

  • Sorting Algorithms in Python Guide
  • Quiz on Sorting

Recommended DSA Problems:

  • Check for Sorted Array
  • Segregate 0s and 1s
  • Wave Array
  • Merge Two Sorted Arrays
  • Intersection of Two Sorted Arrays

4. String

String is a sequence of characters enclosed within single quotes (' ') or double quotes (" "). They are immutable, so once a string is created, it cannot be altered. Strings can contain letters, numbers, and special characters, and they support a wide range of operations such as slicing, concatenation, etc.

Note: As strings are immutable, modifying a string will result in creating a new copy.

Python String Example:

Python
s = "Hello Geeks"
print(s)

Output
Hello Geeks

Related Posts:

  • Python String Guide
  • Python String Quiz
  • Python String Exercise

Recommended DSA Problems:

  • Reverse a String
  • Check for Binary
  • Camel Case Conversion
  • Check for Panagram
  • Check for Palindrome

5. Set

Set is a built-in collection in Python that can store unique elements of different data types. It is an unordered collection, meaning the elements do not maintain any specific order as they are added. Sets do not allow duplicate elements and automatically remove duplicates.

Python Set Example:

Python
a = {10, 20, 20, "GfG", "GfG", True, True}
print(a)

Output
{'GfG', True, 10, 20}

Related Posts:

  • Python Set Guide
  • Python Set Quiz
  • Python Set Exercise

Recommended DSA Problems:

  • Check for Subset
  • Check for Disjoint
  • Union of Two Arrays
  • Intersection of Two Arrays
  • Pair with Given Sum

6. Dictionary

Dictionary is an mutable, unordered (after Python 3.7, dictionaries are ordered) collection of data that stores data in the form of key-value pair. It is like hash tables in any other language. Each key in a dictionary is unique and immutable, and the values associated with the keys can be of any data type, such as numbers, strings, lists, or even other dictionaries. We can create a dictionary by using curly braces ({}).

Python Dictionary Example:

Python
# Creating a Dictionary
d = {10 : "hello", 20 : "geek", "hello" : "world", 2.0 : 55}
print(d)

Output
{10: 'hello', 20: 'geek', 'hello': 'world', 2.0: 55}

Related Posts:

  • Python Dictionary Guide
  • Python Dictionary Quiz
  • Python Dictionary Exercise

Recommended DSA Problems:

  • Max Distance Between Two Occurrences
  • Intersection of Two Arrays
  • 2 Sum – Count pairs with given sum
  • Count pairs with given difference
  • Minimum Removals for no common


Python Data Structures and Algorithms

7. Recursion

Recursion is a programming technique where a function calls itself in order to solve smaller instances of the same problem. It is usually used to solve problems that can be broken down into smaller instances of the same problem.

Related Posts:

  • Python Recursion Guide
  • Python Recursion Quiz

Recommended DSA Problems:

  • Print N to 1 without loop
  • Print N Fibonacci Numbers
  • Factorial of a Number
  • Tower of Hanoi
  • Generate Parentheses

8. Stack

Stack is a linear data structure that stores items in a Last-In/First-Out (LIFO) manner. In stack, a new element is added at one end and an element is removed from that end only. The insert and delete operations are often called push and pop. In Python, we can implement Stack using List Data Structure.

Stack Example in Python:

Python
stack = []

# append() function to push element in the stack
stack.append('g')
stack.append('f')
stack.append('g')

print('Initial stack')
print(stack)

# pop() function to pop element from stack in
# LIFO order
print('\nElements popped from stack:')
print(stack.pop())
print(stack.pop())
print(stack.pop())

print('\nStack after elements are popped:')
print(stack)

Output
Initial stack
['g', 'f', 'g']

Elements popped from stack:
g
f
g

Stack after elements are popped:
[]

Related Posts:

  • Python Stack Guide

Recommended DSA Problems:

  • Parenthesis Checker
  • Evaluation of Postfix Expression
  • Next Greater Element
  • Buildings Facing The Sun
  • Stock Span Problem

9. Queue

Queue is a data structure that follows the First-In, First-Out (FIFO) principle, meaning the first element added is the first one to be removed. The insert and delete operations are often called enqueue and dequeue.

Queue Example in Python

Python
queue = []

# Adding elements to the queue
queue.append('g')
queue.append('f')
queue.append('g')

print("Initial queue")
print(queue)

# Removing elements from the queue
print("Elements dequeued from queue")
print(queue.pop(0))
print(queue.pop(0))
print(queue.pop(0))

print("Queue after removing elements")
print(queue)

Output
Initial queue
['g', 'f', 'g']
Elements dequeued from queue
g
f
g
Queue after removing elements
[]

Related Posts:

  • Python Queue Guide

Recommended DSA Problems:

  • Stack using Two Queues
  • Sliding Window Maximum
  • BFS of Graph
  • Maximum score from at most K jumps
  • Rotten Oranges

10. Linked List

Linked List is a linear data structure where elements, called nodes, are stored in a sequence. Each node contains two parts: the data and a reference (or link) to the next node in the sequence. The last node points to None, indicating the end of the list. Linked List allows for efficient insertions and deletions, especially when elements need to be added or removed from the beginning or middle of the list, as no shifting of elements is required.

Linked List Example in Python:

Python
# Node class
class Node:
    def __init__(self, data):
        self.data = data
        self.next = None


if __name__=='__main__':

    # Create a linked list
    # 10 -> 20 -> 30
    head = Node(10)
    head.next = Node(20)
    head.next.next = Node(30)
    
    # Print the list
    temp = head
    while temp != None:
        print(temp.data, end = " ")
        temp = temp.next

Output
10 20 30 

Related Posts:

  • Python Linked List Guide

Recommended DSA Problems:

  • Length of Linked List
  • Search in Linked List
  • Nth Node from End
  • Middle of Linked List
  • Reverse Linked List

11. Tree

Tree Data Structure is a non-linear data structure in which a collection of elements known as nodes are connected to each other via edges such that there exists exactly one path between any two nodes. Trees are used in many areas of computer science, including file systems, databases and even artificial intelligence.

Tree Example in Python:

Python
# Structure of a Binary Tree Node
class Node:
    def __init__(self, v):
        self.data = v
        self.left = None
        self.right = None
        
def printInorder(root):
    if(root == None):
        return
    printInorder(root.left)
    print(root.data, end = " ")
    printInorder(root.right)

if __name__ == '__main__':
    
    # Construct Binary Tree of 4 nodes
    root = Node(1)
    root.left = Node(2)
    root.right = Node(3)
    root.left.left = Node(4)
    
    printInorder(root)

Output
4 2 1 3 

Related Posts:

  • Trees in Python

Recommended DSA Problems:

  • Inorder Traversal
  • Preorder Traversal
  • Postorder Traversal
  • Level Order Traversal
  • Height of Binary Tree
  • Search a node in BST
  • Minimum in BST
  • Floor in BST
  • Inorder Successor in BST
  • Check for BST

12. Heap

Heap is a complete binary tree that satisfies the heap property. It can be used to implement a priority queue. A max heap is a complete binary tree where the value of each node is greater than or equal to the values of its children, and the min heap is where the value of each node is less than or equal to the values of its children.

 Heap Example in Python:

Python
import heapq

a = [5, 7, 9, 1, 3]

# using heapify to convert list into heap
heapq.heapify(a)

# printing created heap
print ("The created heap is:", a)

# Push 4 into the heap
heapq.heappush(a, 4)

# printing modified heap
print ("The modified heap after push is:", a)

# using heappop() to pop smallest element
print ("The smallest element is:", heapq.heappop(a))

Output
The created heap is: [1, 3, 9, 7, 5]
The modified heap after push is: [1, 3, 4, 7, 5, 9]
The smallest element is: 1

Related Posts:

  • Python Heap Guide

Recommended DSA Problems:

  • Check if Binary Tree is Heap
  • Check if Array is Heap
  • Heap Sort
  • K Largest Elements
  • Sort Nearly Sorted Array

13. Graphs

Graph is a non-linear data structure consisting of a collection of nodes (or vertices) and edges (or connection between the nodes). More formally a Graph can be defined as a Graph consisting of a finite set of vertices(or nodes) and a set of edges that connect a pair of nodes.

Graphs

Related Posts:

  • Graphs in Python

Recommended DSA Problems:

  • BFS of Graph
  • DFS of Graph
  • Topological Sort
  • Number of Islands
  • Check for Bipartite

14. Dynamic Programming

Dynamic Programming (DP) is a technique for solving problems by breaking them into smaller subproblems and storing their solutions to avoid redundant computations. It is used when a problem has overlapping subproblems and optimal substructure.


Related Posts:

  • Dynamic Programming in Python

Recommended DSA Problems:

  • Nth Fibonacci Number
  • Nth Tribonacci Number
  • Climbing Stairs
  • Weighted Climbing Stairs
  • Nth Catalan Number


Next Article
Data Structures and Algorithms (DSA) MCQ Quiz Online
author
abhishek1
Improve
Article Tags :
  • Python
  • DSA
  • Python-DSA
Practice Tags :
  • python

Similar Reads

  • GeeksforGeeks Practice - Leading Online Coding Platform
    GeeksforGeeks Practice is an online coding platform designed to help developers and students practice coding online and sharpen their programming skills with the following features. GfG 160: This consists of 160 most popular interview problems organized topic wise and difficulty with with well writt
    6 min read
  • DSA Tutorial - Learn Data Structures and Algorithms
    DSA (Data Structures and Algorithms) is the study of organizing data efficiently using data structures like arrays, stacks, and trees, paired with step-by-step procedures (or algorithms) to solve problems effectively. Data structures manage how data is stored and accessed, while algorithms focus on
    7 min read
  • Commonly Asked Data Structure Interview Questions
    To excel in a Data Structure interview, a strong grasp of fundamental concepts is crucial. Data structures provide efficient ways to store, organize, and manipulate data, making them essential for solving complex problems in software development.Interviewers often test candidates on various data str
    6 min read
  • Learn DSA with Python | Python Data Structures and Algorithms
    This tutorial is a beginner-friendly guide for learning data structures and algorithms using Python. In this article, we will discuss the in-built data structures such as lists, tuples, dictionaries, etc. and some user-defined data structures such as linked lists, trees, graphs, etc.1. ListList is a
    8 min read
  • Data Structures and Algorithms (DSA) MCQ Quiz Online
    Welcome to our Data Structures and Algorithms (DSA) MCQ Quiz Online! This DSA MCQ is all about Quizzes for solving problems and learning the fundamentals of Algorithms and Data Structures. You'll see multiple-choice questions (MCQs) that test how well you understand the basics and Data structure Alg
    4 min read
  • Top 100 Data Structure and Algorithms DSA Interview Questions Topic-wise
    DSA has been one of the most popular go-to topics for any interview, be it college placements, software developer roles, or any other technical roles for freshers and experienced to land a decent job. If you are among them, you already know that it is not easy to find the best DSA interview question
    3 min read
  • Interview Preparation Roadmap
    Preparing for technical interviews can often feel overwhelming due to the breadth of topics involved. However, a well-structured roadmap makes it easier to focus on the right subjects and systematically build your skills.Interview Preparation RoadmapThis article outlines a step-by-step preparation p
    5 min read
  • Company Wise Interview Preparation
    When diving into the tech job scene, it's valuable to know that each tech company has its own way of hiring. Whether they're into products, services, or analytics, they all have their unique styles.In the preparation guide, we've rounded up popular articles, problem-solving tips, and even a few vide
    1 min read
  • Technical Interview Questions
    Technical interviews are a crucial part of the hiring process for many tech companies like Amazon, Microsoft, Cisco, Google, Facebook, etc. as they test your technical skills, knowledge, and problem-solving abilities. The purpose of a technical interview is to test how you solve real-world problems,
    5 min read
  • Microsoft Interview Preparation
    Microsoft Corporation, the name itself tells a lot about it. An American multinational technology corporation of personal computer software systems and applications, owned by Bill Gates. Under the umbrella of Microsoft, there are over 101 products, services, & apps, you probably don’t know about
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

'); // $('.spinner-loading-overlay').show(); let script = document.createElement('script'); script.src = 'https://assets.geeksforgeeks.org/v2/editor-prod/static/js/bundle.min.js'; script.defer = true document.head.appendChild(script); script.onload = function() { suggestionModalEditor() //to add editor in suggestion modal if(loginData && loginData.premiumConsent){ personalNoteEditor() //to load editor in personal note } } script.onerror = function() { if($('.editorError').length){ $('.editorError').remove(); } var messageDiv = $('
').text('Editor not loaded due to some issues'); $('#suggestion-section-textarea').append(messageDiv); $('.suggest-bottom-btn').hide(); $('.suggestion-section').hide(); editorLoaded = false; } }); //suggestion modal editor function suggestionModalEditor(){ // editor params const params = { data: undefined, plugins: ["BOLD", "ITALIC", "UNDERLINE", "PREBLOCK"], } // loading editor try { suggestEditorInstance = new GFGEditorWrapper("suggestion-section-textarea", params, { appNode: true }) suggestEditorInstance._createEditor("") $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = true; } catch (error) { $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = false; } } //personal note editor function personalNoteEditor(){ // editor params const params = { data: undefined, plugins: ["UNDO", "REDO", "BOLD", "ITALIC", "NUMBERED_LIST", "BULLET_LIST", "TEXTALIGNMENTDROPDOWN"], placeholderText: "Description to be......", } // loading editor try { let notesEditorInstance = new GFGEditorWrapper("pn-editor", params, { appNode: true }) notesEditorInstance._createEditor(loginData&&loginData.user_personal_note?loginData.user_personal_note:"") $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = true; } catch (error) { $('.spinner-loading-overlay:eq(0)').remove(); editorLoaded = false; } } var lockedCasesHtml = `You can suggest the changes for now and it will be under 'My Suggestions' Tab on Write.

You will be notified via email once the article is available for improvement. Thank you for your valuable feedback!`; var badgesRequiredHtml = `It seems that you do not meet the eligibility criteria to create improvements for this article, as only users who have earned specific badges are permitted to do so.

However, you can still create improvements through the Pick for Improvement section.`; jQuery('.improve-header-sec-child').on('click', function(){ jQuery('.improve-modal--overlay').hide(); $('.improve-modal--suggestion').hide(); jQuery('#suggestion-modal-alert').hide(); }); $('.suggest-change_wrapper, .locked-status--impove-modal .improve-bottom-btn').on('click',function(){ // when suggest changes option is clicked $('.ContentEditable__root').text(""); $('.suggest-bottom-btn').html("Suggest changes"); $('.thank-you-message').css("display","none"); $('.improve-modal--improvement').hide(); $('.improve-modal--suggestion').show(); $('#suggestion-section-textarea').show(); jQuery('#suggestion-modal-alert').hide(); if(suggestEditorInstance !== null){ suggestEditorInstance.setEditorValue(""); } $('.suggestion-section').css('display', 'block'); jQuery('.suggest-bottom-btn').css("display","block"); }); $('.create-improvement_wrapper').on('click',function(){ // when create improvement option clicked then improvement reason will be shown if(loginData && loginData.isLoggedIn) { $('body').append('
'); $('.spinner-loading-overlay').show(); jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.unlocked-status--improve-modal-content').css("display","none"); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { showErrorMessage(e.responseJSON,e.status) }, }); } else { if(loginData && !loginData.isLoggedIn) { $('.improve-modal--overlay').hide(); if ($('.header-main__wrapper').find('.header-main__signup.login-modal-btn').length) { $('.header-main__wrapper').find('.header-main__signup.login-modal-btn').click(); } return; } } }); $('.left-arrow-icon_wrapper').on('click',function(){ if($('.improve-modal--suggestion').is(":visible")) $('.improve-modal--suggestion').hide(); else{ } $('.improve-modal--improvement').show(); }); const showErrorMessage = (result,statusCode) => { if(!result) return; $('.spinner-loading-overlay:eq(0)').remove(); if(statusCode == 403) { $('.improve-modal--improve-content.error-message').html(result.message); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); return; } } function suggestionCall() { var editorValue = suggestEditorInstance.getValue(); var suggest_val = $(".ContentEditable__root").find("[data-lexical-text='true']").map(function() { return $(this).text().trim(); }).get().join(' '); suggest_val = suggest_val.replace(/\s+/g, ' ').trim(); var array_String= suggest_val.split(" ") //array of words var gCaptchaToken = $("#g-recaptcha-response-suggestion-form").val(); var error_msg = false; if(suggest_val != "" && array_String.length >=4){ if(editorValue.length { jQuery('.ContentEditable__root').focus(); jQuery('#suggestion-modal-alert').hide(); }, 3000); } } document.querySelector('.suggest-bottom-btn').addEventListener('click', function(){ jQuery('body').append('
'); jQuery('.spinner-loading-overlay').show(); if(loginData && loginData.isLoggedIn) { suggestionCall(); return; } // script for grecaptcha loaded in loginmodal.html and call function to set the token setGoogleRecaptcha(); }); $('.improvement-bottom-btn.create-improvement-btn').click(function() { //create improvement button is clicked $('body').append('
'); $('.spinner-loading-overlay').show(); // send this option via create-improvement-post api jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { showErrorMessage(e.responseJSON,e.status); }, }); });
"For an ad-free experience and exclusive features, subscribe to our Premium Plan!"
Continue without supporting
`; $('body').append(adBlockerModal); $('body').addClass('body-for-ad-blocker'); const modal = document.getElementById("adBlockerModal"); modal.style.display = "block"; } function handleAdBlockerClick(type){ if(type == 'disabled'){ window.location.reload(); } else if(type == 'info'){ document.getElementById("ad-blocker-div").style.display = "none"; document.getElementById("ad-blocker-info-div").style.display = "flex"; handleAdBlockerIconClick(0); } } var lastSelected= null; //Mapping of name and video URL with the index. const adBlockerVideoMap = [ ['Ad Block Plus','https://media.geeksforgeeks.org/auth-dashboard-uploads/abp-blocker-min.mp4'], ['Ad Block','https://media.geeksforgeeks.org/auth-dashboard-uploads/Ad-block-min.mp4'], ['uBlock Origin','https://media.geeksforgeeks.org/auth-dashboard-uploads/ub-blocke-min.mp4'], ['uBlock','https://media.geeksforgeeks.org/auth-dashboard-uploads/U-blocker-min.mp4'], ] function handleAdBlockerIconClick(currSelected){ const videocontainer = document.getElementById('ad-blocker-info-div-gif'); const videosource = document.getElementById('ad-blocker-info-div-gif-src'); if(lastSelected != null){ document.getElementById("ad-blocker-info-div-icons-"+lastSelected).style.backgroundColor = "white"; document.getElementById("ad-blocker-info-div-icons-"+lastSelected).style.borderColor = "#D6D6D6"; } document.getElementById("ad-blocker-info-div-icons-"+currSelected).style.backgroundColor = "#D9D9D9"; document.getElementById("ad-blocker-info-div-icons-"+currSelected).style.borderColor = "#848484"; document.getElementById('ad-blocker-info-div-name-span').innerHTML = adBlockerVideoMap[currSelected][0] videocontainer.pause(); videosource.setAttribute('src', adBlockerVideoMap[currSelected][1]); videocontainer.load(); videocontainer.play(); lastSelected = currSelected; }

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences