Rajarathinam Antony
BAN USER- 0of 0 votes
AnswersDesign a class in such way that all the objects created have the same state(synced).
- Rajarathinam Antony in India
(i.e)For example,
We have a TextBox class, and instantiated in 3 places. when the user types any text in any of the
textboxes other textboxes also should reflect the same text.| Report Duplicate | Flag | PURGE
Capgemini Senior Software Development Engineer - 0of 0 votes
AnswersDesign a datastructure which stores employee details Name,PhoneNumber,Addres and the employee details are(all the 3 given above) fetched when the user searches the data structure by Name or phone number
- Rajarathinam Antony in India| Report Duplicate | Flag | PURGE
ThoughtWorks SDE1 Algorithm - 0of 0 votes
AnswersTwo files are there file1.txt, file2.txt - both have some random names.
- Rajarathinam Antony in India
Like,
file1.txt file2.txt
---------- -----------
Raja Uthaya
Antony Karthi
Christopher Raja
Manickam Antony
Veeramani
Assume file1.txt can have more names(whole database of names), file2.txt has some selected names
You have to display what are all the mismatching items from file1.txt
Need efficient algorithm to do this| Report Duplicate | Flag | PURGE
Honeywell Software Developer Algorithm
Node* findMiddleNode(Node* start)
{
if(start)
{
Node* ptr1 = start;
Node* ptr2 = start;
while( ptr2->next != NULL)
{
ptr1 = ptr1->next;
ptr2 = ptr2->next->next;
}
return ptr1;
}
else
{
return NULL;
}
}
#include <boost/regex.hpp>
#include <string>
#include <iostream>
int main()
{
std::string s ="L\"\\?\\UNC\\10.1.3.23\\TOKEN$\\0x46456\\C\\FileDrive\\Testcase.doc";
boost::regex expr{"(\\\\)0x(\\d)+"};
std::string fmt{""};
std::cout << boost::regex_replace(s, expr, fmt) << '\n';
}
#include <boost/regex.hpp>
#include <string>
#include <iostream>
int main()
{
std::string s ="L\"\\?\\UNC\\10.1.3.23\\TOKEN$\\0x46456\\C\\FileDrive\\Testcase.doc";
boost::regex expr{"(\\\\)0x(\\d)+"};
std::string fmt{""};
std::cout << boost::regex_replace(s, expr, fmt) << '\n';
}
Forgot the token after "TOKEN$".....let me update and post again
- Rajarathinam Antony December 09, 2015With C++11 regex.....
- Rajarathinam Antony December 09, 2015{{
#include <cstdio>
#include <string>
#include <iostream>
#include <vector>
#include <regex>
using namespace std;
int main ()
{
string result;
string string_to_split ="L\"\\?\\UNC\\10.1.3.23\TOKEN$\\C\\FileDrive\\Testcase.doc";
std::regex rgx("TOKEN\\$");
std::sregex_token_iterator iter(string_to_split.begin(),
string_to_split.end(),
rgx,
-1);
std::sregex_token_iterator end;
for ( ; iter != end; ++iter)
{
result += *iter;
}
std::cout << result << '\n';
return 0;
}
}}
Hi, Can any one send me the C/C++ code for knapsack problem
- Rajarathinam Antony January 30, 2012
- Rajarathinam Antony February 29, 2016