Re: [algogeeks] binary search tree over btree

2012-04-04 Thread sanjiv yadav
In BST the height can be made as bad as u can but in case of btree the height can not be more than log n base 2 because for each internal node it is necessary to have at least 2 child and here all the leaf nodes must be at the same label. On Sun, Apr 1, 2012 at 8:34 PM, arun kumar wrote: > hi i

[algogeeks] binary search tree over btree

2012-04-01 Thread arun kumar
hi i just like to know when you will go for binary search tree over btree. advantage and disadvantage, application of both of them. thank you in advance Regards, Arun kumar -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group

[algogeeks] Binary Search Tree Question

2012-02-09 Thread Rahul Menon
What does this function do? void function(Node **node){ if(*node!=NULL){ function(&(*node)->Left); Node *temp; temp = (*node)->Left; (*node)->Left= (*node)->Right; (*node)->Right = temp; functio

Re: [algogeeks] Binary Search Problem

2012-01-13 Thread gvk
These may be of interest as well: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5045582 https://webcache.googleusercontent.com/search?q=cache:onpOivQX668J:googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html+&cd=1&hl=en&ct=clnk&client=ubuntu On Sunday, January 8, 201

Re: [algogeeks] Binary Search Problem

2012-01-08 Thread sravanreddy001
@atul: +1, i too thought the same this comes handly esp, when the derived datatypes are used with a range limitations. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/

Re: [algogeeks] Binary Search Problem

2012-01-08 Thread Sanjay Rajpal
@Atul : got it. thanx :) * Sanjay Kumar B.Tech Final Year Department of Computer Engineering National Institute of Technology Kurukshetra Kurukshetra - 136119 Haryana, India Contact: +91-8053566286 * On Sun, Jan 8, 2012 at 3:27 AM, atul anand wrote: > @Sanjay: suppose Max_INT range is 300 > >

Re: [algogeeks] Binary Search Problem

2012-01-08 Thread atul anand
@Sanjay: suppose Max_INT range is 300 now suppose end=300 and start =2 now using (start+end)/2 i.e *302*/2 but 302 goes out of range for and interger type as assumed... but if we use start + (end-start)/2 THEN 2 + (300-2)/2 , i.e 2+ *298*/2 here 298 < 300 hence it within int_Max range which

Re: [algogeeks] Binary Search Problem

2012-01-08 Thread Sanjay Rajpal
actually book pages are images. My question is why second statement may result in overflow ? * Sanjay Kumar B.Tech Final Year Department of Computer Engineering National Institute of Technology Kurukshetra Kurukshetra - 136119 Haryana, India Contact: +91-8053566286, +91-9729683720 * On Sun, Jan

Re: [algogeeks] Binary Search Problem

2012-01-08 Thread saurabh singh
not clear what you are trying to ask...can you quote exactly from the book? Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Sun, Jan 8, 2012 at 4:34 PM, Sanjay Rajpal wrote: > In binary search, > > mid = start + (end-start)/2 is used to avoid overflow, a

[algogeeks] Binary Search Problem

2012-01-08 Thread Sanjay Rajpal
In binary search, mid = start + (end-start)/2 is used to avoid overflow, as said by a book. why can't we use mid = (start + end)/2, it says this statement may result in overflow ? * Sanjay Kumar B.Tech Final Year Department of Computer Engineering National Institute of Technology Kurukshetra Kuru

Re: [algogeeks] binary search

2011-08-01 Thread Abhishek Gupta
@anurag +1 On Mon, Aug 1, 2011 at 8:53 AM, Anurag atri wrote: > int Modified_BinarySearch(int A[], int N, int value) { >int low = 0; >int high = N; >while (low < high) { >int mid = (low + high)/2; >if (A[mid] < va

Re: [algogeeks] binary search

2011-07-31 Thread Anurag atri
int Modified_BinarySearch(int A[], int N, int value) { int low = 0; int high = N; while (low < high) { int mid = (low + high)/2; if (A[mid] < value) low = mid + 1; else

[algogeeks] binary search

2011-07-31 Thread aditi garg
How to optimise binary search so dat it makes only one comparison instead of 2 dat it generally does?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this g

[algogeeks] binary search tree question!!!!

2011-07-28 Thread AMAN AGARWAL
Please tell the solution of this question Given a Binary Search Tree, write a program to print the kth smallest element without using any static/global variable. You can’t pass the value k to any function also -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to cont

Re: [algogeeks] binary search for Linked List?

2011-03-10 Thread UTKARSH SRIVASTAV
what is skip list On Fri, Mar 11, 2011 at 5:58 AM, priya mehta wrote: > use skip list:) > > > On Thu, Mar 10, 2011 at 2:31 PM, ravi teja wrote: > >> @Utkarsh : >> >> Yeah , that is when you can access any element in O(1) time and the >> elements are sorted.This happens in a sorted array where y

Re: [algogeeks] binary search for Linked List?

2011-03-10 Thread priya mehta
use skip list:) On Thu, Mar 10, 2011 at 2:31 PM, ravi teja wrote: > @Utkarsh : > > Yeah , that is when you can access any element in O(1) time and the > elements are sorted.This happens in a sorted array where you get an overall > complexisty of O(logn). > > -- > You received this message becau

Re: [algogeeks] binary search for Linked List?

2011-03-10 Thread ravi teja
@Utkarsh : Yeah , that is when you can access any element in O(1) time and the elements are sorted.This happens in a sorted array where you get an overall complexisty of O(logn). -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to th

Re: [algogeeks] binary search for Linked List?

2011-03-09 Thread UTKARSH SRIVASTAV
but as far as i know binary search takes O(logn)time tosearch an element On Tue, Mar 8, 2011 at 9:35 PM, ravi teja wrote: > Yes , it is possible . But it does not make sense . The thing that matters > while doing binary search for arrays is that we can access any element in > O(1) time . Bu

Re: [algogeeks] binary search for Linked List?

2011-03-08 Thread ravi teja
Yes , it is possible . But it does not make sense . The thing that matters while doing binary search for arrays is that we can access any element in O(1) time . But , for a linked list it becomes an average of O(n) . And on average we have an O(nlogn) algorithm with highly confusing code and messy

[algogeeks] binary search for Linked List?

2011-03-08 Thread Sudhir mishra
Is it possible to implement -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more optio

Re: [algogeeks] binary search tree

2010-10-06 Thread gaurav gupta
I guess this list is not to get your home works done. Please use google before throwing anything and everything here. On Wed, Oct 6, 2010 at 1:57 PM, addicted2abhishesh < abhishesh.srivast...@gmail.com> wrote: > WAP to create a binary search tree and search a node in it using > linked list repre

[algogeeks] binary search tree

2010-10-06 Thread addicted2abhishesh
WAP to create a binary search tree and search a node in it using linked list representation -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send

[algogeeks] Binary search

2009-02-28 Thread jaanu
Given a sorted arrays of N integers, possibly with duplicates, write a function that returns the highest index of an element X in that array if found or -1 otherwise.(use Binary search) --~--~-~--~~~---~--~~ You received this message because you are subscribed to t