Determining whether one string is a cyclic rotation of another? [closed] - string

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I need to solve the following problem:
Give a linear-time algorithm to determine if a text T is a cyclic rotation of another string T'. For example, arc and car are cyclic rotations of each other.
I have no idea where to start. How can I solve this problem?

As a hint: if x and y have the same length, then x is a cyclic rotation of y iff x is a substring of yy. Try proving this and using this as the basis for your algorithm.
Hope this helps!

Related

How to do string concatation to make a list [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Let I have two string. Say, "learn" and "haskell". How can make them list like ["learn","haskell"]
makeListFromTwoThings :: a -> a -> [a]
makeListFromTwoThings x y = [x,y]
Edit: I am assuming you want a function that does this generically. If you want to do this in the Haskell shell then it seems like nothing is stopping you from typing ["learn","haskell"] directly. If you are trying to solve some more general problem directly in the shell then let us know the details of that problem.

how to create stacked histogram or dotplot in stata [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have several variables with monthly stock returns like qqqret, gldret,spyret. I would like to create a stacked histogram or dotplot of them all on the same scale. any ideas how?
thanks!
ps. if i stack my vectors on top of each other and create an indicator variable for each one I could use strip plot. but i want to be able to say something like "hist qqqret gldret spyret"
dotplot supports a varlist: see the help.
stripplot (SSC) is an alternative.

Plotting Lines in Excel [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I have data in the following format:
Variable - Value
A 1
B 2
A 3
B 4
and so on.
Notice how the variable is recurring for different values. I want to draw a line for each variable that shows its different values assuming the X-axis is time.
Please any help.
I would start off by creating a Pivot table based on the data that you have and then create the line graph from there.

Finding presence of palindromic sequence in a string [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How do I find if a string contains a contiguous palindromic sequence ? I could try the naive solution in O(n^2) time where n is the string size , but any efficient algos to it ?
Well looking for just any palindrome isn't particularly interesting since every one character string is a palindrome. If you are looking for the longest palindrome you may be interested in Manacher's Algorithm.
A good description of the algorithm can be found here.
This is a quite common problem, and has ample results on google:
http://en.wikipedia.org/wiki/Longest_palindromic_substring
Rather than using Manacher's Algorithm you should use one of the parallel algorithms.
duplicate of : how to find longest palindromic subsequence?

how to connect 4 random points with 4 no intersecting line segments? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
The points are in a plane,marked with two numbers indicating coordinates.give out a connect sequence.
Take the convex hull. If it is a quadrilateral, you are done. If it is a triangle, you can break any of its edges apart to include the inner point.

Resources