Issue # 25: IT training - topical issues and tasks from leading companies
Today we have prepared the last issue of IT training in the current format.
We picked up tasks for you from Cisco interviews. They ask questions not only about routing and hardware (there are such questions in the selection), but also logical tasks. The most interesting of them are waiting for you under the cat.
It should also be noted that this issue will be the last in this format, but will continue in a modified form. We decided to change the format and the site for the subsequent editions of IT training - the sequel will be in the Typical programmer.
search binary tree , which has the following properties:
* The left subtree for each node contains numbers less than the value of this node.
* The right subtree for each node contains numbers greater than the value of this node.
* Both the left and right subtrees are binary search trees.
It follows from the described that each node in the tree contains a unique key.
Your task is to write a program to check whether the tree is a binary search tree or not.
Liter, water and 2
smocking "Coprime" vessels
There are two vessels of 'a' and 'b' respectively. We have infinite water supply. Give an efficient algorithm to make exactly 1 liter of water in one of the vessels. You can throw all the water from any vessel. Assume that 'a' and 'b' are Coprimes.
There are given 2 vessels with capacities 'a' and 'b' and an infinite source of water. Suggest an effective algorithm for measuring exactly 1 liter of water with the help of these vessels. You can pour all the water from any vessel at any time. We also assume that 'a' and 'b' are relatively prime numbers .
The answers will be given within the next week - do not hesitate to decide. Good luck!
It may be interesting
find the best coffee maker
best websites for coffee lovers