11. How to find median of a BST?

Find the no. of elements on the left side.
If it is n-1 the root is the median.
If it is more than n-1, then it has already been found in the left subtree.
Else it should be in the right subtree12. What is Diffie-Hellman?

It is a method by which a key can be securely shared by two users without any actual exchange.

13. What is the goal of the shortest distance algorithm?
The goal is completely fill the distance array so that for each vertex v, the value of distance[v] is the weight of the shortest path from start to v.

14. Explain the depth of recursion?

This is another recursion procedure which is the number of times the procedure is called recursively in the process of enlarging a given argument or arguments. Usually this quantity is not obvious except in the case of extremely simple recursive functions, such as FACTORIAL (N), for which the depth is N.

15. Explain about the algorithm ORD_WORDS?

This algorithm constructs the vectors TITLE, KEYWORD and T_INDEX.

16. Which are the sorting algorithms categories?

Sorting algorithms can be divided into five categories:
a) insertion sorts
b) exchange sorts
c) selection sorts
d) merge sorts
e) distribution sorts

17.Define a brute-force algorithm. Give a short example.

A brute force algorithm is a type of algorithm that proceeds in a simple and obvious way, but requires a huge number of steps to complete. As an example, if you want to find out the factors of a given number N, using this sort of algorithm will require to get one by one all the possible number combinations.

18. What is a greedy algorithm? Give examples of problems solved using greedy algorithms.

A greedy algorithm is any algorithm that makes the local optimal choice at each stage with the hope of finding the global optimum. A classical problem which can be solved using a greedy strategy is the traveling salesman problem. Another problems that can be solved using greedy algorithms are the graph coloring problem and all the NP-complete problems.

19. What is a backtracking algorithm? Provide several examples.

It is an algorithm that considers systematically all possible outcomes for each decision. Examples of backtracking algorithms are the eight queens problem or generating permutations of a given sequence.

20. What is the difference between a backtracking algorithm and a brute-force one?

Due to the fact that a backtracking algorithm takes all the possible outcomes for a decision, it is similar from this point of view with the brute force algorithm. The difference consists in the fact that sometimes a backtracking algorithm can detect that an exhaustive search is unnecessary and, therefore, it can perform much better.a
{"ft_lang_label":"__label__en","ft_lang_prob":0.89495087,"math_prob":0.9901505,"size":2704,"snap":"2020-45-2020-50","text_gpt3_token_len":548,"char_repetition_ratio":0.14222223,"word_repetition_ratio":0.0,"special_character_ratio":0.20303254,"punctuation_ratio":0.10192308,"nsfw_num_words":1,"has_unicode_error":false,"math_prob_llama3":0.998643,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,8,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-10-23T06:08:30Z\",\"WARC-Record-ID\":\"<urn:uuid:04a11250-7a25-46ab-8dd9-cb55722a9831>\",\"Content-Length\":\"53498\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e9824e27-1e9b-48f5-b9ef-c124e3e548bc>\",\"WARC-Concurrent-To\":\"<urn:uuid:eb8ef2f4-e987-4242-86c6-fff45a784120>\",\"WARC-IP-Address\":\"166.62.13.1\",\"WARC-Target-URI\":\"http://theblogreaders.com/algorithm-technical-interview-questions-and-answers-for-freshers-part-2/\",\"WARC-Payload-Digest\":\"sha1:K7X53BBIMYYEFBMJ65GMENWBSVV3ITUJ\",\"WARC-Block-Digest\":\"sha1:DKKAGQGOZJLQWA2XO7H2UQHC77CCKXPN\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-45/CC-MAIN-2020-45_segments_1603107880656.25_warc_CC-MAIN-20201023043931-20201023073931-00380.warc.gz\"}"}