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
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
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
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
@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/
@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
>
>
@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
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
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
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
@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
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
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
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
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
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
@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
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
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
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
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
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
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
23 matches
Mail list logo