coderz.py

Keep Coding Keep Cheering!

DSA: Types of Tree

There are various varieties of trees that are often used in the context of Data Structures and Algorithms (DSA). Here are a few of the most important: Binary Tree: A binary tree is a type of tree data structure in which each node can only have two children. The left child is the left subtree, […]

May 17, 2023 | Data Structure | No comments

DSA: Trees

What is Tree Data Structure? A tree data structure is made up of nodes that are connected via edges. The root node is the topmost node in a tree, and it is connected to zero or more child nodes. Each child node can have zero or more child nodes attached to it, establishing a hierarchical […]

May 14, 2023 | Data Structure | No comments

Problems based on Linked List

Let us see a few problems based on Linked List. Given a linked list of N nodes such that it may contain a loop. A loop here means that the last node of the link list is connected to the node at position X(1-based index). If the link list does not have any loop, X=0. Remove the […]

May 14, 2023 | Data Structure | No comments

DSA: Linked List

What is a Linked List? A linked list is a linear data structure composed of nodes, each of which holds a value and a reference (or pointer) to the next node in the list. The first node is referred to as the list’s head, while the last node is referred to as the list’s tail. […]

May 14, 2023 | Data Structure | No comments

Recursion in DSA

What is Recursion? In computer science, recursion is a strong programming technique that is used in many algorithms and data structures. In the context of data structures and algorithms, recursion refers to a function calling itself to solve a problem or conduct a computation, either directly or indirectly. Working & usage of Recursion in DSA: […]

May 13, 2023 | Data Structure | No comments

DSA: Collision in Hashing

What is Collision in Hashing? In hashing, collisions occur when two or more keys yield the same hash value or hash code. Collisions are unavoidable because hash algorithms transfer a theoretically unlimited collection of keys to a finite range of hash results. We have certain collision strategies that we can use to resolve these problems. […]

May 12, 2023 | Data Structure | No comments

DSA: Hashing

What is Hashing? Hashing is a computer science technique for mapping arbitrary-size input to a fixed-size result. A Hash table is a data structure that stores some information, and the information has basically two main components, i.e., key and value. Cryptography, data indexing, data retrieval, and checksum creation are among applications that employ hash functions. […]

May 6, 2023 | Data Structure | No comments

Problems based on Strings

In the previous post, we got an introduction to Strings and their methods. Let us now take a look at a few problems related to it. Given a string s, return the longest palindromic substring in s. Example: Input: s = “babad” Output: “bab” Explanation: “aba” is also a valid answer. Solution: Time complexity: O(n^3), where n is the length […]

May 3, 2023 | Data Structure | No comments

DSA: Strings Concept

What is a String? A string is a character sequence in computer science. It’s one of the most used data types in programming, and it’s used to represent text like names, addresses, and messages. Storage: A string is normally stored in memory as a contiguous block of memory holding the character sequence. Depending on the […]

May 2, 2023 | Data Structure | No comments

Bucket Sort

What is Bucket Sort? Bucket Sort is a sorting method that divides an array into tiny buckets before sorting the elements within each bucket separately using another sorting algorithm, often insertion sort. It is mainly useful when input is uniformly distributed over a range. Algorithm: The algorithm for bucket sort is as follows: Create a […]

May 2, 2023 | Data Structure | No comments

Advertisement