Detecting plagiarism made easy.
Score: 0.7516223788261414; Reported for: String similarity
Open both answers
Original - Posted on 2010-07-23
Present in both answers;
Present only in the new answer;
Present only in the old answer;
It needs to be on both end in client side and server(callee and caller) side too.
1. This is most effective one.
2. Client validation will Reduce one request to server.
3. To reduce the bandwidth traffic.
4. Time comsuming (if it has delay responase from server)
1. Not to believe on UI data (due to hackers).
2. Mostly backend code will be reused, so we dont know whether the data will be null,etc,. so we need to validate on both callee and caler methods.
1. If data comes from UI, Its always better to validate in UI layer and make an double check in server layer.
2. If data transfer with in server layer itself, we need to validate on callee and for double check, we requre to do on caller side also.
Fenwick Tree. It's a data structure to keep count of the sum of all elements in a vector, between two given subindexes i and j. The trivial solution, precalculating the sum since the begining doesn't allow to update a item (you have to do O(n) work to keep up).
Fenwick Trees allow you to update and query in O(log n), and how it works is really cool and simple. It's really well explained in Fenwick's original paper, freely available here:
Its father, the RQM tree is also very cool: It allows you to keep info about the minimum element between two indexes of the vector, and it also works in O(log n) update and query. I like to teach first the RQM and then the Fenwick Tree.