bool Validation(TreeNode *root, int min, int max)
 {
     if(!root)
     return true;
     
     bool ValLeft = Validation(root->left,min,root->val);
     bool ValRight = Validation(root->right,root->val,max);
     if(ValLeft && ValRight)
     return (root->val>min && root->val<max);
     else
     return false;
 }
Example #2
0
Wt::WWidget *FormWidgets::validation()
{
  Wt::WTemplate *result = new TopicTemplate("forms-validation");
  result->bindWidget("Validation", Validation());
  result->bindWidget("ValidationDate", ValidationDate());
  result->bindWidget("ValidationModel", ValidationModel());

  // Show the XML-template as text
  result->bindString("validation-template", reindent(tr("validation-template")),
                     Wt::PlainText);
  return result;  
}
Example #3
0
 UartProfile::UartProfile(int port,
 	int rate, 
 	DataBits dataBits, 
 	StopBits stopBits,
     ParityType parityType,
     FlowType flowType) :
     m_port(port),
     m_dataBits(dataBits),
     m_stopBits(stopBits),
     m_parityType(parityType),
     m_flowType(flowType),
     m_baudRate(rate),
     m_readWriteTimeoutMs(500)
 {
     Validation();
 }
 bool isValidBST(TreeNode *root) {
     // IMPORTANT: Please reset any member data you declared, as
     // the same Solution instance will be reused for each test case.
     return Validation(root,INT_MIN,INT_MAX);
 }
Example #5
0
File: main.cpp Project: CCJY/coliru
 test ( Range&& range, Encoding&& encoding = Encoding(), Validation&& validation = Validation() ) {
     
 }