Given a random string S and another string T with unique elements, find the minimum consecutive sub-string of S such that it contains all the elements in T.
For example:
S=adobecodebanc
T=abc
answer=’banc’
Given a random string S and another string T with unique elements, find the minimum consecutive sub-string of S such that it contains all the elements in T.
For example:
S=adobecodebanc
T=abc
answer=’banc’
Given n, print numbers from zero to n sequentially using two threads such that one thread prints only odds and other prints only evens.
This is a simple classical thread synchronization problem. Before moving to the solution I would like revise basic process, thread, and synchronization/concurrency concepts. Some of the figures in this article are taken from this Silberschatz OS book.