Skip to content

Only Code

Eat Code Sleep – repeat

  • Home
  • Arrays
  • Linked Lists
  • Trees
  • Stacks
  • Queues
  • Heaps
  • Graphs
  • Algorithms+
    • Sorting
    • Dynamic Programming
    • Divide and Conquer
    • Backtracking & Recursion
    • Greedy approach
    • Breadth First Search (BFS)
    • Depth First Search (DFS)

Only Code

Eat Code Sleep – repeat

Close menu
  • Home
  • Arrays
  • Linked Lists
  • Trees
  • Stacks
  • Queues
  • Heaps
  • Graphs
  • Algorithms+
    • Sorting
    • Dynamic Programming
    • Divide and Conquer
    • Backtracking & Recursion
    • Greedy approach
    • Breadth First Search (BFS)
    • Depth First Search (DFS)

Only Code

Eat Code Sleep – repeat

Search Toggle menu

Category: Algorithms

Solving the Fractional Knapsack Problem

While the 0/1 Knapsack problem restricts you to take an item entirely, Fractional Knapsack problem allows you to take fractions of an item.

Algorithms, Greedy approach, Mathematics

Travelling Salesman Problem using Held-Karp Algorithm | Dynamic Programming

The Held-Karp algorithm is an efficient dynamic programming approach for solving the Travelling Salesman Problem (TSP). The algorithm builds up a table to store the optimal cost of visiting subsets of cities.

Algorithms, Dynamic Programming, Graphs

Travelling Salesman Problem using Nearest Neighbour Algorithm

Given a list of cities and the distances between each pair of cities, find the shortest possible route that visits each city exactly once and returns to the origin city.

Algorithms, Graphs, Greedy approach

Comparing Performance of Disjoint-Set Algorithms: Quick Union, Quick Find, and Weighted Quick Union

Disjoint-set data structures, commonly known as Union-Find, are fundamental data-structures in computer science for efficiently solving problems related to connectivity in graphs or set operations.

Algorithms, Computer Science, Special Data Structures

Mersenne Twister Algorithm vs rand(): Generating Random Numbers

Understanding the differences between the Mersenne Twister algorithm and rand() method helps in selecting the appropriate method based on specific programming needs.

Algorithms, C/C++, Interview Questions

Comparing Order Statistics Algorithm and Min Heap for Finding the Kth Smallest Element

Both methods provide effective solutions for finding the kth smallest element in a list of numbers. Understanding their strengths and trade-offs will help you select the most suitable approach for your use case.

Algorithms, Computer Science, Heaps, Special Data Structures

Understanding P, NP, and NP-Complete

This so-called P ≠ NP question has been one of the deepest, most perplexing open research problems in theoretical computer science.

Algorithms, Computer Science

Knuth-Morris-Pratt (KMP) | String Searching Algorithm

The KMP algorithm improves the efficiency of string searching by utilizing the information gathered from previous character comparisons. It avoids unnecessary character comparisons by exploiting the knowledge of the pattern itself.

Algorithms

Permutations of a string

Each of these permutations represents a unique arrangement of the elements. Total number of permutations of a set will always be n!

Algorithms, Backtracking & Recursion

Understanding Prim’s Algorithm for Minimum Spanning Tree in C++

Prim’s Algorithm is a popular greedy algorithm used to find the Minimum Spanning Tree (MST) of a connected, weighted graph.

Algorithms, Graphs, Greedy approach

Posts pagination

< 1 2 3 … 9 >
  • Algorithms
  • Arrays
  • Backtracking & Recursion
  • Breadth First Search (BFS)
  • C/C++
  • Competitive Programming
  • Computer Science
  • Data Science
  • Databases
  • Depth First Search (DFS)
  • Divide and Conquer
  • Dynamic Programming
  • Graphs
  • Greedy approach
  • Hashmaps
  • Heaps
  • Interview Questions
  • Java
  • Linked Lists
  • Machine Coding Questions
  • Machine Learning
  • Mathematics
  • Networking
  • Programming Projects
  • Python
  • Queues
  • Sorting
  • Special Data Structures
  • Stacks
  • Trees
  • Web Development
© 2025 Only Code | Aureolls
Exit mobile version