Java code to find index of longest repeated letters in a string

Here’s the Java code to find index of the longest consecutive sequence of repeated letters in a string. If there is more than one run with the same length, the index of the first one is returned.
For example, if the string is(“bbbccffffiiiffff”), the program should return 5 as the longest sequence is ffff and it first appears on index 5.

Continue reading

Java code to determine the validity of a binary search tree

Write a code to determine the validity of a binary search tree (BST). A binary search tree is rooted binary tree, whose internal nodes each store a key and each have two distinguished sub-trees, commonly denoted left and right. The key in each node must be greater than all keys stored in the left sub-tree, and smaller than all keys in right sub-tree. Below is an example of a BST:

Binary_search_tree

Continue reading

Concurrency control in Group Editor

Computer-supported cooperative work

A key component in such group editor is concurrency control. The existing technique include floor control, locking, serialization, or operational transformation.

Adoption of the operational transformation technique is highly recommended as it has obvious benefits that others do not have. For that purpose, you are provided with a few research papers describing different implementation strategies and operational transformation functions and control algorithms.

The focus of this project is on the communication and synchronisation, therefore, you are encouraged to use any existing text editor, e.g., as simple as a Java JTextArea, and any communication protocol such as socket, remote procedure call, or http.