CSD201_-_SU_2023_-_Block_5_-_RE_759.webp
Vân Anh1

CSD201_-_SU_2023_-_Block_5_-_RE_759.webp

(Choose 1 answer)
Suppose we are considering a binary search tree.Select the most correct java code snippet that search a node with value x on the sub-tree with root p.
A.Node search(Node p, int x){if(p.info==x) return(p);
if(x<p.info)return(search(p.left,x));elsereturn(search(p.right,x));}
B. Node search(Node p, int x){ if(p==null) return(null);if(p.info==x) return(p);if(x<p.info)return(search(p.left,x));elsereturn(search(p.right,x));}
C. Node search(Node p, int x){ if(p==null) return(null);if(p.info==x) return(p);if(x<p.info)return(search(p.right,x));elsereturn(search(p.left,x));
}


Exit 46

Thông tin

Category
CSD201
Thêm bởi
Vân Anh1
Ngày thêm
Lượt xem
1,844
Lượt bình luận
22
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
CSD201_-_SU_2023_-_Block_5_-_RE_759.webp
File size
59.1 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom