Tag: data structure
-
DSA BasicsStack in DSA
What is a Stack? A stack is an abstract data type that adheres to the Last-In-First-Out (LIFO) principle in the…
May 23, 2023
-
DSA BasicsQueues in DSA
What is a Queue in DSA? A queue is a linear data structure that holds elements in a certain order. It accesses items using the FIFO (First In First Out) method. It can only be changed by adding data entities at one end…
May 26, 2023
-
DSA BasicsBinary Search Tree (BST)
A Binary Search Tree (BST) is a type of binary tree that satisfies the following properties: For any node in…
May 29, 2023
-
DSA BasicsTrees: Lowest Common Ancestor
What is the Lowest Common Ancestor? In a tree, the lowest common ancestor (LCA) of two nodes, n1 and n2,…
May 30, 2023
-
DSA BasicsDSA: Trie
What is a Trie in DSA? A trie, often known as a prefix tree, is a tree-like data structure used…
May 31, 2023
-
DSA BasicsDSA: Heap
A heap is a specialized tree-based data structure that satisfies the heap property. It is commonly used to implement priority…
June 10, 2023
-
PythonTwo Sum: Check for Two Numbers with Sum K
Problem Statement (Asked By Google) Given a list of integers and a target number k, determine if there exist two…
December 29, 2024
-
DSA SheetProduct of Array Except Self
Problem Statement (Asked By Uber) Given a list of integers, return a new list such that each element at index…
December 30, 2024
-
DSA SheetSerialize and Deserialize a Binary Tree
Given the root of a binary tree, create two functions: serialize(root) – Converts the binary tree into a string representation….
January 1, 2025
-
DSA SheetFind the Smallest Missing Positive Integer
Problem Statement (Asked By Stripe) You are given an array of integers. Your task is to find the smallest missing…
January 2, 2025
-
DSA SheetConstruct and Deconstruct a Pair
Problem Statement (Asked By Jane Street) The function cons(a, b) creates a pair of two elements. Implement two functions: For…
January 3, 2025
-
DSA SheetImplement an XOR Linked List
An XOR-linked list is a memory-efficient version of a doubly linked list. Instead of each node storing separate next and…
January 4, 2025