Madhav Ganesanmadhavganesan.hashnode.dev·Jul 22, 2024How to calculate time and space complexity?Finding time and space complexity for a problem might be very difficult until you read this blog:) Time complexity: The time complexity of an algorithm is the amount of time it takes for each statement to complete. Worst case: It is a scenario in whi...DiscussC++
Anower Hossainanower77.hashnode.dev·Jul 14, 2024Segment Tree-1Segment Tree Basic Node Divide With Segment Tree Node Numbering (Segment Tree) // build (node, begin, end) build (1, 1, N) { L = 2xN, R = (2xN) + 1 // Node Number Calculate mid = (begin + end) / 2 left = (L, begin, mid) left = (R, ...Discuss·91 readssegment-tree
Rachit Kesharirachitk.hashnode.dev·Jul 11, 2024127. Word LadderQue: A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s<sub>1</sub> -> s<sub>2</sub> -> ... -> s<sub>k</sub> such that: Every adjacent pair of words differs by a single let...DiscussJava
Anto Jebikshanantojebikshan.hashnode.dev·Jul 7, 2024Getting Started with Competitive Programming: A Guide for BeginnersIntroduction: Competitive programming is an exciting and rewarding activity that challenges your problem-solving skills and enhances your coding abilities. Whether you're a beginner looking to improve your programming skills or aiming to participate ...Discuss·12 likes·36 readsProgramming Blogs
Anower Hossainanower77.hashnode.dev·Jul 7, 2024Recursion & Backtracking1-Recursion-Basic #include "bits/stdc++.h" using namespace std; void solve(int n) { if(n==0) return; solve(n-1); cout<< n << " "; } int main() { ios::sync_with_stdio(false); cin.tie(NULL); int n; cin>>n; solve(n); ...Discuss2-Tree-Recursion
Abrar Eyasireyasir2047.hashnode.dev·Jul 2, 2024Number of Divisors Using Prime FactorizationQuestion: Given a positive integer n, we must find the total number of divisors for n. Let d( n ) be the number of divisors for the natural number, n. We begin by writing the number as a product of prime factors: n = p^a* q^b* r ^c … then the number ...Discuss·1 likedivisors
Animesh Kumaranimeshk.hashnode.dev·Jul 1, 2024Backtracking: The Hidden Gem of Problem-SolvingBacktracking is a powerful and often underrated technique in computer science. It's like a problem-solving Swiss Army knife that can help you find solutions to complex problems efficiently. In this blog, we'll explore what backtracking is, how it wor...Discuss·10 likes2Articles1Week
Madhav Ganesanmadhavganesan.hashnode.dev·Jun 29, 2024Bitwise Operations for CP (DSA - 1)Bitwise operations are fundamental to many programming tasks and for competitive programming. This blog will cover the basic bitwise operations, including AND, OR, XOR, NOT, left shift, and right shift, with examples to illustrate their usage. What a...Discuss·10 likesBeginner Developers
Abhishek Dandriyalabhishek-dandriyal.hashnode.dev·Jun 26, 2024Create Hello World FunctionWrite a function createHelloWorld. It should return a new function that always returns "Hello World". Example 1: Input: args = [] Output: "Hello World" Explanation: const f = createHelloWorld(); f(); // "Hello World" The function returned by create...Discuss30 days leetcode with javascipt
Arman Jasujaarmanjasuja.hashnode.dev·Jun 17, 2024An interesting Codeforces problemMotivation I have been getting into competitive programming recently, and came across an interesting problem on Codeforces that I felt like sharing here. This particular problem took a while for me to get my head around, but it was a lot of fun! Prob...DiscussCompetitive programming