let's start Code

Showing posts with label Algorithm. Show all posts
Showing posts with label Algorithm. Show all posts

Maximum Number of Points in a Line

Share:

A* search algorithm

Share:

Expression parsing

Share:

Suffix Automaton

Share:

Suffix Tree

Share:

D - Coloring Edges on Tree

Problem link: Coloring Edges on Tree

Explanation: GfG

Implementation:


Share:

Cutting a Rod

Cutting a Rod


Tushar Roy Video 

Medium blog post 

Implementation 01:


 

 Aplication:


 

Share:

Edit Distance

Share:

Word Wrap Problem (text justification)

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:

F1. Tree Cutting (Easy Version

F1. Tree Cutting (Easy Version)

Topic: DFS

Concept: āĻĒ্āϰāϤিāϟা āĻĒ্āϝাāϰেāύ্āϟ āĻāϰ āϚাāχāϞ্āĻĄ āĻ•োāύ āĻ•োāύ āĻ•াāϞাāϰ āφāĻ›ে āϤাāϰ āĻšিāϏাāĻŦ āϰাāĻ–āĻŦো, āϝেāĻŽāύ āĻĒ্āϰāĻĨāĻŽ āωāĻĻাāĻšāϰāύে -
ā§§ āύং āύোāĻĄেāϰ āϚাāχāϞ্āĻĄ āĻāϰ āϏংāĻ–্āϝা āĻšāĻŦে ā§§āϟা āϞাāϞ, ⧍āϟা āύীāϞ , ā§§āϟা āύāϰāĻŽাāϞ।
⧍ āύং āύোāĻĄেāϰ āϚাāχāϞ্āĻĄ āĻāϰ āϏংāĻ–্āϝা āĻšāĻŦে ā§§āϟা āϞাāϞ, ā§§āϟা āύীāϞ , ⧍āϟা āύāϰāĻŽাāϞ।
ā§Š āύং āĻāϰ ā§§āϟা āύāϰāĻŽাāϞ (āύিāϜেāϰ āĻ•াāϞাāϰ)।
ā§Ē āύং āύোāĻĄেāϰ āϚাāχāϞ্āĻĄ āĻāϰ āϏংāĻ–্āϝা āĻšāĻŦে ā§§āϟা āϞাāϞ ( āĻāχāϟা āĻŦাāĻĻ āĻĻি⧟ে āĻāύ্āϏাāϰ āĻĒাāĻŦ)।
ā§Ģ āύং āύোāĻĄেāϰ āϚাāχāϞ্āĻĄ āĻāϰ āϏংāĻ–্āϝা āĻšāĻŦে 1āϟা āύীāϞ।

Solution 01:


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:

Fractional Knapsack Problem

Share:

About

let's start CODE

Popular Posts

Categories