Jump to content
xisto Community

varalu

Members
  • Content Count

    466
  • Joined

  • Last visited

Everything posted by varalu

  1. nice words.... this makes me feel bad... Anyways nice one...nice words... You must be a bit unlucky i guess...
  2. Given a linked list, find the 5th last element with Time complexity O(n) and minimal space complexity. Note: If you know the answer and if you feel it is simple also please post the answers so that others will come to know about the answers. What is a linked list?? /* this is for your further reference and reading */ There are various kinds of linked lists available and can be implemented in many languages and in different ways. Applications of Linked Lists even bad solutions are welcome... .
  3. Given a binary tree, write an algorithm to find its mirror image with minimal time and space complexities. Note: If you know the answer and if you feel it is simple also please post the answers so that others will come to know about the answers. This question was sent by my friend through mail. Solutions Suggested Sol 1 void PrintMirror(node *root){ if(node!=NULL) PrintMirror(root->right); Printf(root->data); PrintMirror(root->left); }In case of implementation using array 2i+1 stores left child of ith node and 2i+2 stores right element. for(int i=0;i<(2^levels)-1;i++){ swap(tree[2i+1],tree[2i+2]);} Note: Null nodes are also to be swaped hence (2^levels)-1 -- Suggested by my friend... Sol 2 Another Solution.... void Mirror(node *ptr){ if(ptr!=(node *) NULL) { node* right=ptr->right; Mirror(ptr->left); Mirror(ptr->right); ptr->right=ptr->left; ptr->left=right; }}Time complexity : O(n). Each node is processed once.Space complexity : only one temp ptr used. More solutions welcome... Notice from rvalkass: Double post merged. Remember the edit button is available for you to use. Also, any code needs to be in CODE tags. One more Solution here... Sol 3 One more algo node* mirror(node **tree){ node * temptree; if(*tree!=(node*)NULL) { temptree =(node*)malloc(sizeof(node)); temptree->left = mirror(tree->right); temptree->data = tree->data; temptree->right = mirror(tree->left); return(temptree); } else printf("Tree is empty !!");
  4. Hi OneMinute... You can subsctibe yourself to be notified for the next blog action day.... Below is the link. Register to 2008 Blog Action Day They will notify the next time. Spread the word.
  5. Answer to Question 3 Was just wondering whats the practical use of this?? https://en.wikipedia.org/wiki/Lowest_common_ancestor The above wiki link explains things. Also gives applications where the "common ancestor" thing can be used...
  6. Age is not a constraint here i guess...If situation demands and if they are matured enough to handle them, they understand their purpose they can be given one. But again...lot of discretion should be already taught to them when it comes to handling things on their own.
  7. I wish something like the above could happen to me.... But i am far from that. I was jogging and exercising regularly in the beginning.. but had a break now. Wanted to start it so badly. will be starting shortly.
  8. The above is an extract from my blog. You will be able to get many results on this topic in google. May be i believe the next time, the number of bloggers involved would increase exponentially. Hope this happens and the world turns back and something good happens. http://forums.xisto.com/no_longer_exists/ The above link has the complete post.
  9. ya man. I believe in "Life After Death". Not in the exact crude sense... but more in philosophical way.When people remember you for your deeds then it means you are still living among them.This again depends on what you do when you were living. If you have done something worth mentioning and have made yourself influential among people, and you created some difference or bought about some change in some lives... you will be remembered. This i believe is "Life after death."If you want me to give an apt answer for your question... i myself have many doubts regarding this... i get totally confused when i start thinking about life, death, its purpose, present, past, future... etc.So live this moment and enjoy life.
  10. Yep... that would be a really nice gift.but then it has to be in sync with the liking of your lover. Else everything crashes.
  11. The above is the description given to the new dating site... that says that they do things differently. So why dont you give a try if you really want to get a better date. . The interface and look and feel of the website is good. Below is the website link. Enjoy !!!. http://forums.xisto.com/no_longer_exists/
  12. @fariezYep... Its totally free. Its there in the home page. Also i don see them getting any card details or specifications about money. So go ahead.
  13. Hey Sm...Congrats from my side. Convey my regards to all of them.Do post some pics if possible.
  14. I have been using blogger for over the past 3-4 years. It totally rocks. Blogger is the best platform for blogging newbies and best for beginners. Advanced users may go ahead with custom domains or with other blogging platforms like wordpress etc. I own 4 blogs in blogger. Below are mu blogs... The entire experience with blogger is very good. Its fast and easy to learn. Also google indexes it so fast, so your contents will be online(reflect in searches...) very soon.. Also the templates are very good. Moreover there are many third parties providing many customized templates that you can choose from. @shadowdemon Thats sick man... you are in Xisto and i see a bit of activity... But you have never heard of blogger?? Its there everywhere man... If you know Google you should be knowing blogger also.
  15. The question should have been "Who is your best Soccer Player"... . LOL...Mine is Ronaldinho... He is a class player... His moves...I also like henry of france... also few others.
  16. @SmThanks for your suggestion... No... I still have many suggestions myself and updating them on a regular basis. Will try to implement your suggestions. And regarding the support from major charity organisations... i am in the process of contacting them. Hope i succeed...All the best to me. And talking about a community... still thinking about that. Will check. Thanks again...@teknoTomThanks ma... i agree... a bit bloggish. But this is not a blog template. May change in the future. Thanks again for your feedback.
  17. Another answer to question 1 Use a hash table hash function = (X- an element in the array) This function returns the key value,Array element can be used as index in the hash table stored along with the key value... Every time a key is calculated it is checked whether the element is present in the table time complexity O(n) ya space wise its pooor working........ Array of elements - {2, 3,1000, 200, 51, 88, 29, 49, 65, 40, 98, 12, 3} Sum - 100. X=100 till 51 the hash table values are 2 98 3 97 51 49 200 -100 1000 -900 for 88 and 29 2 98 3 97 29 71 51 49 88 12 200 -100 1000 -900 now when 49 is taken key = (100-49)=51 but 51 is already present as index Solution suggested by my friend -- Daya.
  18. I have found one combi that fails.... . Given -- {40, 20, 10, 30, 80} Sum -- 50 Actual solution shud have been from values 40(1st ele) and 10(3rd ele). But the algo fails....
  19. Ya...dualstriker.You are right. Nowadays people want everything thats out there for free... They experiment a lot and finish it with the best.Firefox is very goo ...there is no denying that. I am using that..But i find a small problem in Firefox...the memory that is occupied by firefox s very very high when compared to IE or any other browser. When my firefox is running, this is the application that consumes so much of memory. Something better could be done on this....
  20. varalu

    Yo

    Welcome to all newbie's to Xisto.Enjoy your stay here and make it worth. Its full of people who can help you so much.So go ahead and discover something...
  21. Yet another technological breakthrough that will change people's lives. For more about this... go here --> http://forums.xisto.com/no_longer_exists/
  22. You should be taking a look at http://www.oswd.org/. Lots and lots of very good web templates are available. i highly recommend that site. All templates are css validated...so your work gets reduced so much.
  23. Fed up with all the junk mails you receive in your primary mail box?? Tired of deleting all the spam mails you receive?? Advertisers disturb you with many mails?? You are unable to un-subscribe yourself from the third-party?? For all the above problems you have....there is a solution provider. http://ww1.proquo.com/rg-erdr.php?_rpo=t so...what are you waiting for?go ahead and give a try and live spam free.
  24. I also feel it very relaxing... It helps me sleep. I am not sure of the biological effects that it creates in our body.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.