let's start Code

1049 - One Way Roads

1049 - One Way Roads

Topic: DFS

concept: কস্টকে ডিরেক্টটেড ধরবো তারপর আনডিক্টটেড গ্রাফ এ ডিএফএস চালাবো.

Share:

1263 - Equalizing Money

1263 - Equalizing Money

Topic: BFS

Concept: সব গুলা কম্পোনেন্ট এ চেক করবো সমান পরিমান টাকা আছে কিনা।


Share:

TOPOSORT - Topological Sorting

Share:

Topological Sorting

                                                 Resource Link

Topological Sorting (E-Maxx)

Kahn’s algorithm for Topological Sorting

Topological Sorting

TopSort using DFS:


TopSort using BFS: (Kahn’s algorithm)

Share:

1002 - Country Roads

1002 - Country Roads

Topic: dijkstra

solution 01:


Share:

Dijkstra Algorithm

                                               Resource Link

Dijkstra Algorithm

Dijkstra on sparse graphs


Share:

1005 - Rooks

1005 - Rooks

Topic: combinatorics + Binomial Coefficient



Share:

Binomial Coefficient

Share:

DCP-23: Another Bigmod Problem

DCP-23: Another Bigmod Problem

Topic: BigMod

solution:


Share:

1067 - Combinations

1067 - Combinations

Topic: Counting.


Share:

F1. Tree Cutting (Easy Version

F1. Tree Cutting (Easy Version)

Topic: DFS

Concept: প্রতিটা প্যারেন্ট এর চাইল্ড কোন কোন কালার আছে তার হিসাব রাখবো, যেমন প্রথম উদাহরনে -
১ নং নোডের চাইল্ড এর সংখ্যা হবে ১টা লাল, ২টা নীল , ১টা নরমাল।
২ নং নোডের চাইল্ড এর সংখ্যা হবে ১টা লাল, ১টা নীল , ২টা নরমাল।
৩ নং এর ১টা নরমাল (নিজের কালার)।
৪ নং নোডের চাইল্ড এর সংখ্যা হবে ১টা লাল ( এইটা বাদ দিয়ে এন্সার পাব)।
৫ নং নোডের চাইল্ড এর সংখ্যা হবে 1টা নীল।

Solution 01:


Share:

C. Connect

C. Connect

Topic: BFS, Flood Fill, DFS


Share:

Bucket Sort

                  Bucket Sort

geeksforgeeks

hackerearth

visualization

Time Complexity: If we assume that insertion in a bucket takes O(1) time then steps 1 and 2 of the above algorithm clearly take O(n) time. The O(1) is easily possible if we use a linked list to represent a bucket (In the following code, C++ vector is used for simplicity). Step 4 also takes O(n) time as there will be n items in all buckets.
Share:

Heap Sort

                          Heap Sort

Time Complexity: Time complexity of heapify is O(nLogn). Time complexity of createAndBuildHeap() is O(n) and overall time complexity of Heap Sort is O(nLogn).

hackerearth

GeeksForGeeks

visualization


Share:

Radix Sort

Radix Sort

Visualization

                                      Complexity:  O(n+b)*logb(max_value)

Share:

Counting Sort

                    Counting Sort

                       Counting Sort


Share:

Binary Search Tree (BST)

Binary Search Tree

Binary Search Tree (BST) is a node-based binary tree data structure having the following properties:

  1. The left subtree of a node contains only nodes with keys less than the node’s key.
  1. The right subtree of a node contaisns only nodes with greater than the node’s Key.
  1. The left and right subtree each must also be a binary search tree.

BST has some basic operation like Search, Insert, Delete, Traversal (In-order, pre-order, post-order).If we want to delete a node from BST, Firstly we search this node and delete this node.

Now we make a BST using some data and following the BST properties. The data is given below:

                 47,40,54,38,30,39,49,60,57,80;









Share:

Odd Sum SubSequence

problem statement:

You are given sequence *a[1]*, *a[2]*, ..., *a<[n]* of integer numbers of length *n*. Your task is to find such subsequence that its sum is odd and maximum among all such subsequences.
It's guaranteed that given sequence contains subsequence with odd sum.

Subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements.

You should write a program which finds sum of the best subsequence.

Solution:

Share:

Fractional Knapsack Problem

Share:

Egyptian Fraction

      Egyptian Fraction


Share:

Activity Selection Problem

                      Resource:

GeeksForGeeks

Activity Selection Problem

techiedelight

                 Implementation: 01

                 Implementation: 02

Share:

Two Pointer

                          Resource Link:

Shakil Ahmed's Blog

 The Two Pointer Algorithm

Problems:

1121 - Subsequence

11536 - Smallest Sub-Array

ARRAYSUB - subarrays

Chef and Cake

Share:

1121 - Subsequence

1121 - Subsequence

Topic: two pointer

explanation: Shakil Ahmed's Blog

solution 01:

 

Share:

Closest Pair of Points

Share:

Counting Inversions

Share:

QuickSort

                                           Resource Link

Quick Sort

Hasaner Rafkhata

Visualization

GeeksForGeeks

                                        Implementation:



Share:

Merge Sort

                                            Resource Link

GeeksForGeeks

Visualization

Hackerearth

হাসানের রাফখাতা

                                       Implementation:


Share:

About

let's start CODE

Popular Posts