Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
0 answers
72 views

How to efficiently compute similarity scores for prefixes of a string with another string in C?

I'm working on a problem involving string matching where I need to compute the similarity scores for each prefix of a string C against another string S. The similarity score for a prefix P of C and S ...
NatsumiStar's user avatar
2 votes
1 answer
89 views

How to measure performance metric in a dynamic programming algorithm

I am trying to use the Cell Updates Per Second (CUPS) metric to measure the performance of the sequence alignment algorithm. I saw the metric being used in several papers (ref1, ref2)but none of them ...
engineer1155's user avatar
1 vote
1 answer
129 views

Is there a optimal solution for Jump Game Problem using C programming

PROBLEM DESCRIPTION You are given an integer array. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position. Return ...
Mohamed Afsal's user avatar
1 vote
1 answer
102 views

What's the reason for the occurrence of Segmentation fault (core dumped)?

I use C language, and apply Dynamic Programming to solve the Travelling salesman problem. There is such a problem on ZeroJudge, An Online Judge System For Beginners, but I get Segmentation fault (core ...
Eric's user avatar
  • 13
0 votes
2 answers
150 views

How to traverse in 2D matrix not row or column wise but diagonally filling all the coordinates

I was trying to solve a dp question and got struck here during tabulation as through normal method this matrix will be filled row wise or column wise, but I needed values diagonally, instead of row ...
Harsh Anmol's user avatar
0 votes
0 answers
57 views

LeetCode 1416 Restore The Array

I am trying to solve this problem (Restore The Array), and I have gotten close but for some reason can't pass the 83th test which is a big string. I have also saw a very similar solution that did ...
Sagi Sason's user avatar
-1 votes
2 answers
76 views

Memory Limit Exceed in C dynamic array

I am trying to create a 3D array using memory allocation, and free it. However, it seems that my program exceed the memory limit. How can I optimize it? And what point do i miss? function.h unsigned***...
Osiris85's user avatar
1 vote
0 answers
83 views

Dynamic programming with memoization on the rob house problem

This is my problem I'm working on: " You are a professional robber planning to rob houses along a street. The houses are numbered 0, 1, 2, ..., and you my assume that the number of houses is at ...
GaNk1n1t's user avatar
0 votes
1 answer
72 views

Error in Making Change using Dynamic Programming in c

Well i have tried it many time and still unable to find the error in the code below it is making change proble using dynamic programming need help to eliminate the wrong output and if possible plz ...
Pulin Mori's user avatar
1 vote
2 answers
147 views

How do I cast a String to a Long-int in C?

How do i turn a String in C to a Long integer, without removing the leading zero? I have used both sscanf() and strtol() functions but they both remove the leading zero as if its white-space. I have ...
El Barto's user avatar
-1 votes
3 answers
208 views

How to make a dynamic string?`I want to get a string dynamically but i don;t what to use it like this: string = (char*)malloc(100 * sizeof(char)); [closed]

#include<stdio.h> #include<string.h> int main() { char string[100]; printf("Enter string: "); fgets(string, 100, stdin); return 0; } Or we can also do something ...
Manvi Koul's user avatar
1 vote
0 answers
35 views

Unique mapping of 3 integer parameters to an index in a lookup table with offset

I'm working on university assignment, where the goal is to design a recursive algorithm to compute the maximum size of a tower built using a sequence(s) of pallets under the condition that the pallet ...
Nikolai Savulkin's user avatar
2 votes
2 answers
115 views

Dynamic array of structures

I'm a beginner and working with DMA and structure of arrays concept coding to get employee's details like name, address, Employee ID, and their age in structure using an array and arranging the ...
Balaji Baski's user avatar
2 votes
1 answer
168 views

Why does my C code and Python code take more time just for itration in for loop

I have a Python code and a C code. My Python code is this: import os import time count = 0 number_of_itration =100000000 begin = time.time() for i in range(number_of_itration): count += 1 end = ...
Altroz's user avatar
  • 31
0 votes
0 answers
178 views

The Damerau-Levenshtein distance in C

I'm working on a spell checker and I need to optimize the Damerau-Levenshtein distance. For example... when 2 words have a distance greater than 3 (or a limit), I need to break the function. This will ...
Lkx8888's user avatar
  • 33

15 30 50 per page
1
2 3 4 5
14