|
1. Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it. 2. Give a one-line C expression to test whether a number is a power of 2 3. Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all 4. Given an expression remove the unnecessary brackets in it with out creating an ambiguity in its execution. input output ex1: (a+(b)+c) a+b+c ex2: (a*b)+c a*b+c 5. Implement an algorithm to take an array and return one with only unique elements in it. 6. Compare two strings using O(n) time with constant space. 7. Implement an algorithm to print out all files below a given root node. 8. Propose a tree based data structure to identify a node with nth rank with maximum efficiency . 9. Write routines to read and write a bounded buffer. 10. Implement an algorithm to insert a node into a circular linked list without traversing it. 11. Given a binary tree verify whether it is a binary search tree or not? 12. Given a string S of words and no of character per line m ,with m being greater than the longest word in S,print S in a set of lines so that each line contains no more than m characters and no word split between 2 lines. 13. Give me an algorithm to shuffle a deck of cards, given that the cards are stored in an array of ints. 14. Write routines to manage a heap using an existing array. 15. The following asm block performs a common math function, what is it? cwd xor ax, dx sub ax, dx
|