Click here to Skip to main content
15,890,185 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Weather Prediction using minimal data Pin
Richard MacCutchan18-May-13 5:42
mveRichard MacCutchan18-May-13 5:42 
AnswerRe: Weather Prediction using minimal data Pin
Joezer BH16-Jun-13 23:29
professionalJoezer BH16-Jun-13 23:29 
QuestionBest autorrelation function Pin
Russell'7-May-13 0:36
Russell'7-May-13 0:36 
QuestionPattern matching in trees, lists and strings alike Pin
bjongejan11-Apr-13 9:19
bjongejan11-Apr-13 9:19 
AnswerRe: Pattern matching in trees, lists and strings alike Pin
dusty_dex11-Apr-13 11:44
dusty_dex11-Apr-13 11:44 
GeneralRe: Pattern matching in trees, lists and strings alike Pin
bjongejan11-Apr-13 22:49
bjongejan11-Apr-13 22:49 
GeneralRe: Pattern matching in trees, lists and strings alike Pin
dusty_dex11-Apr-13 23:04
dusty_dex11-Apr-13 23:04 
GeneralRe: Pattern matching in trees, lists and strings alike Pin
bjongejan12-Apr-13 9:25
bjongejan12-Apr-13 9:25 
Neither Perl or Scala can solve this simple problem with a simple pattern: Given a list of pairs, each pair consisting of a first name and a family name, give me two names of different persons that have the same family name. I think Tom[^] (a cousin of Scala, I think) can do it, but the syntax of patterns in that language is very verbose. In Bracmat, you would do:

(Abel.Hirst) (Benjamin.Foster) (Letty.Johnson) (George.Hanson) (Chris.Johnson) (Priscilla.Stein):?list;

!list:? (?name1.?familyName) ? (?name2.!familyName) ? & out$(!name1 and !name2 "have the same family name (" !familyName ")") | out$"No two persons have the same family name";

which outputs

Letty and Chris have the same family name ( Johnson )

The pattern is just ? (?name1.?familyName) ? (?name2.!familyName) ?.

Scala only allows a wild card in the tail of a pattern. Perl 6 seems to have modernized its pattern matching, but the subject is still a string, never a list. Correct me if I'm wrong.

For a perhaps more convincing, but longer, example, see Dinesman's multiple-dwelling problem[^].
GeneralRe: Pattern matching in trees, lists and strings alike Pin
Kosta Cherry5-Jun-13 20:04
Kosta Cherry5-Jun-13 20:04 
QuestionAlgorithm Pin
Member 99636023-Apr-13 15:11
Member 99636023-Apr-13 15:11 
AnswerRe: Algorithm Pin
BupeChombaDerrick7-Apr-13 23:39
BupeChombaDerrick7-Apr-13 23:39 
QuestionAlignment and rectification of polylines Pin
Chesnokov Yuriy1-Apr-13 8:09
professionalChesnokov Yuriy1-Apr-13 8:09 
AnswerRe: Alignment and rectification of polylines Pin
Kenneth Haugland2-Apr-13 23:31
mvaKenneth Haugland2-Apr-13 23:31 
AnswerRe: Alignment and rectification of polylines Pin
Lutosław4-Jun-13 12:57
Lutosław4-Jun-13 12:57 
QuestionConsider a complete binary tree with an odd number of nodes. Let n be the number of internal nodes (non-leaves) in the tree. Define the internal path length, I, as the sum, taken over all the internal nodes of the tree, of the depth of each node. Lik Pin
amistry_petlad28-Mar-13 7:08
amistry_petlad28-Mar-13 7:08 
AnswerRe: Consider a complete binary tree with an odd number of nodes. Let n be the number of internal nodes (non-leaves) in the tree. Define the internal path length, I, as the sum, taken over all the internal nodes of the tree, of the depth of each node. Pin
R. Giskard Reventlov28-Mar-13 7:24
R. Giskard Reventlov28-Mar-13 7:24 
AnswerRe: Consider a complete binary tree with an odd number of nodes. Let n be the number of internal nodes (non-leaves) in the tree. Define the internal path length, I, as the sum, taken over all the internal nodes of the tree, of the depth of each node. Pin
Richard MacCutchan28-Mar-13 7:25
mveRichard MacCutchan28-Mar-13 7:25 
GeneralRe: Consider a complete binary tree with an odd number of nodes. Let n be the number of internal nodes (non-leaves) in the tree. Define the internal path length, I, as the sum, taken over all the internal nodes of the tree, of the depth of each node. Pin
amistry_petlad28-Mar-13 7:51
amistry_petlad28-Mar-13 7:51 
GeneralRe: Consider a complete binary tree with an odd number of nodes. Let n be the number of internal nodes (non-leaves) in the tree. Define the internal path length, I, as the sum, taken over all the internal nodes of the tree, of the depth of each node. Pin
Richard MacCutchan28-Mar-13 7:58
mveRichard MacCutchan28-Mar-13 7:58 
AnswerRe: Consider a complete binary tree with an odd number of nodes. Let n be the number of internal nodes (non-leaves) in the tree. Define the internal path length, I, as the sum, taken over all the internal nodes of the tree, of the depth of each node. Pin
Lutosław4-Jun-13 13:06
Lutosław4-Jun-13 13:06 
QuestionThe degree of a node in a tree is the number of children the node has. If a tree has n1 nodes of degree 1, n2 nodes of degree 2, ..., nm nodes of degree m, compute the number of leaves in the tree in terms of n1, n2, . . . , nm. Pin
amistry_petlad28-Mar-13 7:04
amistry_petlad28-Mar-13 7:04 
NewsCaltech's FREE online Machine Learning course -- LAST CHANCE Pin
Matt T Heffron27-Mar-13 11:53
professionalMatt T Heffron27-Mar-13 11:53 
NewsNew computer vision algorithms, check out the videos Pin
BupeChombaDerrick20-Feb-13 20:33
BupeChombaDerrick20-Feb-13 20:33 
GeneralRe: New computer vision algorithms, check out the videos Pin
Simon_Whale1-Mar-13 0:13
Simon_Whale1-Mar-13 0:13 
GeneralRe: New computer vision algorithms, check out the videos Pin
BupeChombaDerrick1-Mar-13 23:24
BupeChombaDerrick1-Mar-13 23:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.