priyankajaggi4
BAN USER- 0of 0 votes
AnswersSeveral Sql Queries.
- priyankajaggi4 in India
eg. relation student -> Student Name| Subject 1| Subject 2| Subject 3 | Subject 4 | Subject 5|
Q- Now find all those students whose subjects are DS or Networking.| Report Duplicate | Flag | PURGE
Yatra.com Software Engineer / Developer Database - 0of 0 votes
Answers5) Find second non repeating element in array.
- priyankajaggi4 in India| Report Duplicate | Flag | PURGE
Yatra.com Software Engineer / Developer Algorithm - 0of 0 votes
Answers2) Inplace Transpose of Matrix.
- priyankajaggi4 in India| Report Duplicate | Flag | PURGE
Yatra.com Software Engineer / Developer Data Structures - 0of 0 votes
Answers1) Write a program to change big endian to little endian.
- priyankajaggi4 in India| Report Duplicate | Flag | PURGE
Yatra.com Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a Binary tree and a pointer to some node in the tree, find the left and right neighbors of the input node. The neighbor nodes are on the same level/depth as of input node.
- priyankajaggi4 in -
Don't use BFS/level order traversal.
There is no parent pointer.| Report Duplicate | Flag | PURGE
- 0of 0 votes
AnswersYou have been given a dictionary containing some words which data structure you will
- priyankajaggi4 in India
use to store all those words and why
You have been given a word you have to find its anagrams within that dictionary
Now you haven’t been given any word you have to find all the anagrams already existing
within given dictionary.
Now you can have as much time as you want for preprocessing of dictionary words
already existing but the solution should give efficient result for accessing the anagram of
given word
Suppose the length of each word in dictionary is of length N and it has M no of words in
dictionary then how much time it will take for preprocessing and after preprocessing to
find the angrams in dictionary
(they were asking for as many solutions as you can give for each question)| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer - 0of 0 votes
AnswersYou have a BST in which each and every node has an extra pointer (called rand) which
- priyankajaggi4 in India
is pointing to any random node within the tree. Now if that rand pointer is pointing to any
of its inorder successor then its fine otherwise you have to make it null.
Now you are also having the duplicate entries in that BST. Now how will you handle it.
Next question was suppose the tree is not BST and also has duplicate entries what will
you do now to handle that rand pointer.
What is the time complexity and space complexity in every solution| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer Algorithm
@ anonymous
i*=2 is correct as at every step we have x*=x that means squaring of x is done and that value is again assigned to x
at given problem loop still breaks at x=81 not at x=27 ( as when i=1 -> x=3*3 =9 , i=2 -> x=9*9 =81 , i=4 -> loop terminates and we get 81 as x)
@vijay that is not right
as x<<n = (2^n) *x= y*x
But something like that i had to do during interview using bit arithmatic, but was not able to figure out exact solution there.
@ scofield , your solution is obvious , but is there any way to even reduce its time complexity.
any other disadvantages for normalization? point no 2 & 3 not clear . somone plz explain them .
- priyankajaggi4 January 12, 2012Joining Three or More Tables:
:
Although each join specification joins only two tables, FROM clauses can contain multiple join specifications. This allows many tables to be joined for a single query.
The titleauthor table of the pubs database offers a good example of a situation in which joining more than two tables is helpful. This Transact-SQL query finds the titles of all books of a particular type and the names of their authors:
USE pubs
SELECT a.au_lname, a.au_fname, t.title
FROM authors a INNER JOIN titleauthor ta
ON a.au_id = ta.au_id JOIN titles t
ON ta.title_id = t.title_id
WHERE t.type = 'trad_cook'
ORDER BY t.title ASC
.
.
.
Here is the result set:
au_lname | au_fname | title
----------------- -------------------- ----------
Blotchet-Halls | Reginald | Fifty Years in Buckingham Palace
Kitchens
Panteley | Sylvia | Onions, Leeks, and Garlic:
Cooking Secrets of the Mediterranean
O'Leary | Michael | Sushi, Anyone?
Gringlesby | Burt | Sushi, Anyone?
Yokomoto | Akiko | Sushi, Anyone?
(5 row(s) affected)
.
.
Notice that one of the tables in the FROM clause, titleauthor, does not contribute any columns to the results. Also, none of the joined columns, au_id and title_id, appear in the results. Nonetheless, this join is possible only by using titleauthor as an intermediate table.
.
The middle table of the join (the titleauthor table) can be called the translation table or intermediate table, because titleauthor is an intermediate point of connection between the other tables involved in the join.
When there is more than one join operator in the same statement, either to join more than two tables or to join more than two pairs of columns, the join expressions can be connected with AND or with OR.
why not object based model?
- priyankajaggi4 January 12, 2012
can we still write more efficient algo for the case when y=2^n.
- priyankajaggi4 January 25, 2012eg: y=2^13
where n=13 ~= 1101. And applying some bit arithmatic here . Interviewer give me only this much of hint . How to reach to a solution from here??