An algorithm is a sequence of well-defined steps that defines an abstract solution to a problem. Use this tag when your issue is related to algorithm design.
0
votes
3answers
52 views
Reverse a linked list using recursion technique in C
I have the following code which I am using to return the reverse of the linked list . Though it reverses the linked list I never get the head of the reversed linked list. Because the restofElements ...
-3
votes
1answer
36 views
Algorithm for sorting elements of an array [on hold]
What is the best array sorting algorithm in general among :
1. Bubble Sort
2. Selection Sort
3. Insertion Sort
And how do we decide upon its efficiency?
0
votes
0answers
22 views
Fill the rectangles with maximum “important” values
We have a rectangle with n rows and m columns filled with numbers from 1 to n*m.
Cell (i,j) of the rectangle is important iff:
* i = 1 and j = 1 (or)
*there is an important cell (a,b) such that ...
1
vote
1answer
48 views
Sign a string in an open source code
Suppose I have a program that generate a string. I want this string to be signed with a private key, such that I can be sure that the string was actually generated by the program and not in any other ...
1
vote
1answer
20 views
Detecting accurate center point of rectangular object using HoughLinesP
I have a object and I would like to define exact center of it. Using OpenCV I detect the edges with Canny and then I perform HoughLinesP to detect lines: http://i.stack.imgur.com/lzY1L.png
I use ...
0
votes
0answers
25 views
Do you know algorithms using a social network?
I want to find examples of algorithms using a social network but not only Facebook, Twitter... But also applications having a social network module like Deezer, Last.fm...
I am writing an essay on ...
0
votes
1answer
25 views
Remove redundant parentheses from an arithmetic expression
This is an interview question, for which I did not find any satisfactory answers on stackoverflow or outside. Problem statement:
Given an arithmetic expression, remove redundant parentheses. E.g. ...
0
votes
2answers
21 views
Finding out vertices which does not have any edges between them
Is there any standard algorithm to categorize vertices into different groups, if there are no edges between them? Tried searching for this, not getting anything specific.
0
votes
1answer
61 views
Comparing two strings using known algortihms
I'm trying to compare two strings (product names) using some of well known algorithms like Levenstein distance and library of different solutions for string simmetrics (got best results with ...
1
vote
3answers
64 views
Python interval interesction
My problem is as follows:
having file with list of intervals:
1 5
2 8
9 12
20 30
And a range of
0 200
I would like to do such an intersection that will report the positions [start end] between ...
2
votes
1answer
70 views
How to make a stable sort of binary values in linear time?
Let us suppose that we have a:
class Widget;
std::vector<Widget>;
And we have a function:
bool belongsToLeft(Widget w);
I would like to sort the container according to this predicate. So ...
0
votes
1answer
35 views
number of different numbers in a given binary string and their sum
I'am thinking of this problem and don't have an idea where to start with >>
We are given a binary string and is there any possible way other than brute force to find number of different numbers(their ...
1
vote
3answers
52 views
Are there any nearest neighbor data structures using a user provided hint?
I am looking for a data structure holding vectors in R^n which could perform nearest neighbor queries using a user provided hint as to which vector is likely to be close to the query. For example:
...
0
votes
2answers
37 views
Index to a position in an array with cumulative values
If I have 8 objects of size '2' and 4 objects of size '4' and 2 objects of size '2'. (This is how my file is how an object is growing. So, for first 2MB sized requests I use first 8 boxes and so and ...
2
votes
1answer
33 views
design a datastructure to return the number of connections to a web server in last 1 minute
Asked this on cs.stackexchange.. got a downvote.. because i was not very clear.. So I will try to be more specific here..
Q - design a datastructure to return the number of connections to a web ...