coderz.py

Keep Coding Keep Cheering!

DSA: Modular Arithmetic

What is Modular Arithmetic in DSA? Modular arithmetic is an arithmetic structure for integers, in which numbers “wrap around” when they reach a certain magnitude. Many areas of mathematics and computer science use modular arithmetic, including number theory, combinatorics, coding theory, and error-correcting codes. It is also utilized in algorithm design and analysis, notably in […]

April 23, 2023 | Data Structure | No comments

Problems based on bit manipulation

In the previous topic, we got an introduction to Bit Manipulation in DSA. Let us now look at some examples using bit manipulation. Given two integers x and y, return the Hamming distance between them: Note: The Hamming distance between two integers is defined as the number of points where the corresponding bits differ. i.e, Input: x = 1, y = […]

April 18, 2023 | Data Structure | No comments

DSA: Bits Manipulation

What is Bits Manipulation? The process of modifying individual bits or groups of bits within a binary representation of data is known as bit manipulation. It is often used in computer programming to execute bit-level operations on data, which can be more efficient than typical arithmetic or logic operations. What is the need for bit […]

April 17, 2023 | Data Structure | No comments

DSA: Sliding Window Technique

What is the Sliding Window Technique? The Window Sliding Technique is a technique for reducing the time complexity of algorithms using nested loops. We can avoid nested loops and obtain greater performance by traversing the array with a single loop and sliding a window over it. Use of Sliding Window Technique for 2D Arrays: A […]

April 17, 2023 | Data Structure | No comments

DSA: 2D Array

What is a 2D Array? A 2D matrix is a two-dimensional array that contains rows and columns in data structures and methods. It is also known as a two-dimensional array. A matrix can be represented in code as a 2D array, where each element of the array is itself an array, and each row of […]

April 15, 2023 | Data Structure | No comments

DSA: SubArray

What is a SubArray? A subarray is a sequence of elements within an array that is contiguous. In other words, a subarray is a section of an array that contains consecutive elements in the same sequence as the original array. Subarrays can range in length from a single element (also considered a subarray) to the […]

April 12, 2023 | Data Structure | No comments

Array Carry Forward

What is Carry Forward? The word “carry forward” does not refer to a specific idea in data structures and algorithms. However, “carry forward” in the context of arrays often refers to the process of relocating entries in an array to fill in empty spaces left by deleted or removed elements. This is also referred to […]

April 12, 2023 | Data Structure | No comments

Prefix Sum in Arrays

What is Prefix Sum? Prefix Sum is a method for dealing with array manipulation challenges. It entails establishing an auxiliary array in which each element keeps the sum of all the components preceding it(including the current element). A prefix sum array is another name for this auxiliary array. Sample example to understand the concept: Explanation: […]

April 10, 2023 | Data Structure | No comments

DSA: Concept of Array

A group of related data elements stored at adjacent memory locations is referred to as an array. One of the most basic data structures, it allows for random access to each data element by its index number. Properties of an Array: Arrays contain a number of crucial characteristics that make them helpful in a wide […]

April 9, 2023 | Data Structure | No comments

Time Complexity

What is Time Complexity? Time complexity is a key concept in computer science, particularly in data structures and algorithms(DSA). It measures how long it takes to run an algorithm or complete a task, and it is usually expressed in terms of the input size. What Is Space Complexity? Space complexity is a measure of the […]

April 9, 2023 | Data Structure | No comments

Advertisement