Wednesday, August 19, 2015

#codingquestion
Given a set of braces or parenthesis in any order with openers defined as [ { or ( and closers defined a s ) } ] , write a function that determines if the brackets are in the correct order.

public book Validator(string input)
{
var brackets = new Stack();
for (int i = 0; i < input.length; i++)
{
 if (input[i] == '[' || input[i] == '{' || input[i] == '(')
{
  brackets.push(input[i]);
}
 if (input[i] == ']' || input[i] == '}' || input[i] == ')')
{
if (brackets.empty()) return false;
var last = brackets.peek();
 if (input[i] == ']' && last != '[') return false;
 if (input[i] == '}' && last != '{') return false;
 if (input[i] == ')' && last != '(') return false;
brackets.pop();
}
}
if (brackets.empty() == false) return false;
return true;
}

Today we take a moment to discuss topic identification and noise clusters. When the topics are clustered by their distance to the centroids while simultaneously weighting the keywords as explained by Frigui, Nasraoui et al., there is a formation of noise clusters that tend to group all the outliers leaving more cohesive clusters behind. Since it attracts all the outliers, only the documents that are similar to the other clusters will remain in their own clusters.

No comments:

Post a Comment