WITHALLREQUIREDTO
s s s s
PASS s
Array N- NCORRECT NANSWER-A Ndata Nstructure Nthat Nstores Nan Nordered Nlist Nof Nitems, Nwith Neach
s s s s s s s s s s s s s s
Nitem Nis Ndirectly Naccessible Nby Na Npositional Nindex.
s s s s s s s s
Linked NList N- NCORRECT NANSWER-A Ndata Nstructure Nthat Nstores Nordered Nlist Nof Nitems Nin Nnodes,
s s s s s s s s s s s s s s
Nwhere Neach Nnode Nstores Ndata Nand Nhas Na Npointer Nto Nthe Nnext Nnode.
s s s s s s s s s s s s s
Bianary NSearch NTree N- NCORRECT NANSWER-A Ndata Nstructure Nin Nwhich Neach Nnode Nstores Ndata Nand
s s s s s s s s s s s s s s
Nhas Nup Nto Ntwo Nchildren, Nknown Nas Na Nleft Nchild Nand Na Nright Nchild.
s s s s s s s s s s s s s s
Hash NTable N- NCORRECT NANSWER-A Ndata Nstructure Nthat Nstores Nunordered Nitems Nby Nmapping N(or
s s s s s s s s s s s s s
Nhashing) Neach Nitem Nto Na Nlocation Nin Nan Narray N(or Nvector).
s s s s s s s s s s s
Hashing N- NCORRECT NANSWER-mapping Neach Nitem Nto Na Nlocation Nin Nan Narray N(in Na Nhash Ntable).
s s s s s s s s s s s s s s s
Chaining N- NCORRECT NANSWER-handles Nhash Ntable Ncollisions Nby Nusing Na Nlist Nfor Neach Nbucket,
s s s s s s s s s s s s s
Nwhere Neach Nlist Nmay Nstore Nmultiple Nitems Nthat Nmap Nto Nthe Nsame Nbucket.
s s s s s s s s s s s s s
Hash Nkey N- NCORRECT NANSWER-value Nused Nto Nmap Nan Nindex
s s s s s s s s s
,bucket N- NCORRECT NANSWER-each Narray Nelement Nin Na Nhash Ntable
s s s s s s s s s
ie NA N100 Nelements Nhash Ntable Nhas N100 Nbuckets
s s s s s s s s
modulo Nhash Nfunction N- NCORRECT NANSWER-computes Na Nbucket Nindex Nfrom Nthe Nitems Nkey.
s s s s s s s s s s s s
It Nwill Nmap N(num_keys N/ Nnum_buckets) Nkeys Nto Neach Nbucket.
s s s s s s s s s
ie... Nkeys Nrange N0 Nto N49 Nwill Nhave N5 Nkeys Nper Nbucket.
s s s s s s s s s s s
50 N/ N10 N= N5 s s s s
hash Ntable Nsearching N- NCORRECT NANSWER-Hash Ntables Nsupport Nfast Nsearch, Ninsert, Nand Nremove.
s s s s s s s s s s s s
Requires Non Naverage NO(1) s s s
Linear Nsearch Nrequires NO(N) s s s
modulo Noperator N% N- NCORRECT NANSWER-common Nhas Nfunction Nuses Nthis. Nwhich Ncomputes Nthe
s s s s s s s s s s s s
Ninteger Nremainder Nwhen Ndividing Ntwo Nnumbers. N
s s s s s s s
Ex: NFor Na N20 Nelement Nhash Ntable, Na Nhash Nfunction Nof Nkey N% N20 Nwill Nmap Nkeys Nto Nbucket
s s s s s s s s s s s s s s s s s s
Nindices N0 Nto N19.
s s s s
Max-Heap N- NCORRECT NANSWER-A Nbinary Ntree Nthat Nmaintains Nthe Nsimple Nproperty Nthat Na Nnode's
s s s s s s s s s s s s s
Nkey Nis Ngreater Nthan Nor Nequal Nto Nthe Nnode's Nchildrens' Nkeys. N(Actually, Na Nmax-heap Nmay Nbe Nany
s s s s s s s s s s s s s s s s s
Ntree, Nbut Nis Ncommonly Na Nbinary Ntree).
s s s s s s s
*a Nmax-heap's Nroot Nalways Nhas Nthe Nmaximum Nkey Nin Nthe Nentire Ntree.
s s s s s s s s s s s
Heap Nstorage N- NCORRECT NANSWER-Heaps Nare Ntypically Nstored Nusing Narrays. NGiven Na Ntree
s s s s s s s s s s s s
Nrepresentation Nof Na Nheap, Nthe Nheap's Narray Nform Nis Nproduced Nby Ntraversing Nthe Ntree's Nlevels
s s s s s s s s s s s s s s s
Nfrom Nleft Nto Nright Nand Ntop Nto Nbottom. NThe Nroot Nnode Nis Nalways Nthe Nentry Nat Nindex N0 Nin Nthe
s s s s s s s s s s s s s s s s s s s s
, Narray, Nthe Nroot's Nleft Nchild Nis Nthe Nentry Nat Nindex N1, Nthe Nroot's Nright Nchild Nis Nthe Nentry Nat Nindex
s s s s s s s s s s s s s s s s s s s s
N2, Nand Nso Non.
s s s s
Max-heap Ninsert N- NCORRECT NANSWER-An Ninsert Ninto Na Nmax-heap Nstarts Nby Ninserting Nthe Nnode Nin
s s s s s s s s s s s s s s
Nthe Ntree's Nlast Nlevel, Nand Nthen Nswapping Nthe Nnode Nwith Nits Nparent Nuntil Nno Nmax-heap Nproperty
s s s s s s s s s s s s s s s s
Nviolation Noccurs.
s s
The Nupward Nmovement Nof Na Nnode Nin Na Nmax-heap Nis Nsometime Ncalled Npercolating.
s s s s s s s s s s s s
Complexity NO(logN) s
Max-heap Nremove N- NCORRECT NANSWER-Always Na Nremoval Nof Nthe Nroot, Nand Nis Ndone Nby Nreplacing
s s s s s s s s s s s s s s
Nthe Nroot Nwith Nthe Nlast Nlevel's Nlast Nnode, Nand Nswapping Nthat Nnode Nwith Nits Ngreatest Nchild Nuntil
s s s s s s s s s s s s s s s s s
Nno Nmax-heap Nproperty Nviolation Noccurs.
s s s s s
Complexity NO(logN) s
Percolating N- NCORRECT NANSWER-The Nupward Nmovement Nof Na Nnode Nin Na Nmax-heap
s s s s s s s s s s s
Min-Heap N- NCORRECT NANSWER-Similar Nto Na Nmax-heap, Nbut Na Nnode's Nkey Nis Nless Nthan Nor Nequal
s s s s s s s s s s s s s s s
Nto Nits Nchildren's Nkeys.
s s s s
Heap N- NParent Nand Nchild Nindices N- NCORRECT NANSWER-Because Nheaps Nare Nnot Nimplemented Nwith
s s s s s s s s s s s s s
Nnode Nstructures Nand Nparent/child Npointers, Ntraversing Nfrom Na Nnode Nto Nparent Nor Nchild Nnodes
s s s s s s s s s s s s s s
Nrequires Nreferring Nto Nnodes Nby Nindex. NThe Ntable Nbelow Nshows Nparent Nand Nchild Nindex Nformulas
s s s s s s s s s s s s s s s
Nfor Na Nheap.
s s s
ie
1) Nparent Nindex Nfor Nnode Nat Nindex N12? N5
s s s s s s s s
*** N((12-1) N// N2) N= N5 Nor N12 N//2 N-1 N= N5
s s s s s s s s s s s
2) Nchild Nindices Nfor Na Nnode Nat Nindex N6? N13 N& N14
s s s s s s s s s s s