Anony
BAN USER- 0of 0 votes
AnswersReverse a string and also check whether it is palindrome or not while you are reversing
- Anony in United States| Report Duplicate | Flag | PURGE
Qualcomm Testing / Quality Assurance - 0of 0 votes
AnswersSwap 2 variables without using a temporary variable
- Anony in United States| Report Duplicate | Flag | PURGE
EMC Developer Program Engineer - 0of 0 votes
AnswersPrint continuous alphabets from a sequence of arbitrary alphabets
- Anony in United States
For example:
Input: abcdefljdflsjflmnopflsjflasjftuvwxyz
Output: abcdef; mnop; tuvwxyz
Input: AbcDefljdflsjflmnopflsjflasjftuvWxYz
Output: abcdef; mnop; tuvwxyz| Report Duplicate | Flag | PURGE
Epic Systems
For a BST this is very easy and Vijay has given the right algorithm.
For a binary tree you can calculate the list of nodes from the root to a particular node.
Do this for both the nodes. Compare their list of ancestors. The last element of the longest matching prefix is the LCA. Very simple.
(nobrainer .co .cc)
This is a page replacement question asked in a different way
We can use the Least Frequently Used (LFU) page replacement algorithm
Each record in the cache can be seen as a node in a linked list. Whenever a record is accessed its count is increased by 1. Whenever a page replacement has to me made we can select the nodes with the least count as the victims.
(nobrainer .co cc)
This is a page replacement question asked in a different way
We can use the Least Frequently Used (LFU) page replacement algorithm
Each record in the cache can be seen as a node in a linked list. Whenever a record is accessed its count is increased by 1. Whenever a page replacement has to me made we can select the nodes with the least count as the victims.
When u enter the URL of say google the following things happen
1. Using DHCP host discovers the IP address of the DNS server.
2. DNS server sends the IP addess of google
3. Host sends a HTTP request to google server
4. This HTTP request is sent over TCP or UDP
(nobrainer. co .cc)
this is a bitonic merge sort algorithm example
- Anony March 02, 2012