1 views

Uploaded by Hitesh Mishra

Great notes

- AmQuake Tutorial
- Development Techniques& New Technologies
- MIT6_851S12_ps1s
- Let's Talk Bitcoin, episode 46, "Life in the Cloud"
- fymca
- CSA-4
- How HashMap Works in Java
- Java Map Interface
- 13 Define Positions
- EON Tutorials
- 200610 Zend Conf Php Extension Development
- VISI Progress
- AlgorithmBasics Examples
- 00065905(7)
- Lec16_HashTables.ppsx
- Lec18Cpsc331
- avl supp
- Descision Tree
- Data Structure Lec11 Handout
- 2015HanoiRegional Problem Sets

You are on page 1of 2

Note that throughout this homework we use ‘B Tree’ to mean ‘B+ Tree’; these conform to the

rules described in lecture.

For the following questions about B trees, show the tree after each insert or delete.

a) Show the result of inserting 12, 10, 15, 4, 1, 17, 3, 13, and 8 into an initially empty B tree

with M = 3 and L = 2. To maintain consistency in answers, please follow the following

rules:

You should split nodes whenever there is an overflow due to insertion; that is, do

not use adoption.

When splitting a leaf node due to insertion overflow, keep half (rounded up) in

the left node and half (rounded down) in the right.

In this problem, assume that every B tree node has a reference to its parent (except for the root

node) as well as its children (except for leaves), so that it is easy to “move up or down” the tree.

Suppose you have a direct reference to the leaf holding a data item with a key k.

a) Describe in English an algorithm for finding the predecessor of k in the B tree (or

determining that k is the minimum element and therefore has no predecessor).

b) Give the worst-case number of total nodes accessed by your algorithm in terms of the

tree height h. Describe briefly a worst-case situation.

c) Give the best-case number of total nodes accessed by your algorithm. Explain briefly

why most keys would exhibit the best-case behavior.

This will give you a chance to get some practice with hash tables, which you will be using in the

current project.

a) For each of the following types of hash-tables, insert the following values in order: 4371,

1323, 6173, 4199, 4344, 9679 and 1989. Assume the table size is 10 and that the

primary hash function is h(k) = k % 10. You do not need to resize the tables. If an

element cannot be successfully inserted, state why. You need only show the final table.

ii. Hash table using linear probing

iii. Hash table using quadratic probing

iv. Hash table with a secondary hash function of h2(k) = 7 – (k % 7)

b) Show the result of rehashing each of your results from part (a). Choose the new table

size to be 19, which is prime and roughly twice as big. When rehashing, insert in the

order in which they are present in your table from part (a) (this is how rehashing is

usually done anyway). If any items were not successfully inserted in part (a), they should

be inserted after the rehash, in the order of their failures.

c) Suppose a hash table is accessed by open addressing and contains a cell X marked as

“deleted". Suppose that the next successful find hits and moves past cell X and finds the

key in cell Y. Suppose we move the found key to cell X, mark cell X as “active" and mark

cell Y as “open". Suppose this policy is used for every find. Would you expect this to

work better or worse compared to not modifying the table? Explain your answer.

d) Suppose that instead of marking cell Y as "open" in the previous question, you mark it as

“deleted" (it contains no value, but we treat it as a collision). Suppose this policy is used

for every find. Would you expect this to work better or worse compared to not

modifying the table? Explain your answer.

- AmQuake TutorialUploaded byrelu59
- Development Techniques& New TechnologiesUploaded byhymarao
- MIT6_851S12_ps1sUploaded bydjoseph_1
- Let's Talk Bitcoin, episode 46, "Life in the Cloud"Uploaded byBen Malec
- fymcaUploaded byShrikant Mishra
- CSA-4Uploaded byShankar Reddy
- How HashMap Works in JavaUploaded byPrasad Chawan
- Java Map InterfaceUploaded byPallab Datta
- 13 Define PositionsUploaded byShravanUday
- EON TutorialsUploaded byAnaRocha
- 200610 Zend Conf Php Extension DevelopmentUploaded byBryana
- VISI ProgressUploaded bytatban2185
- AlgorithmBasics ExamplesUploaded byandronache_costin
- 00065905(7)Uploaded bybluemoon1172
- Lec16_HashTables.ppsxUploaded byKaran Khanchandani
- Lec18Cpsc331Uploaded byTalha Habib
- avl suppUploaded byhamadi_298312254
- Descision TreeUploaded bylakshay212
- Data Structure Lec11 HandoutUploaded byJʋŋaiɗ Aĸɓar
- 2015HanoiRegional Problem SetsUploaded byLê Trần Bảo Cương
- r12featurespresentation-inventorymanagement-120213032832-phpapp02Uploaded byVikram Reddy
- SAP - Data Medium Exchange (DME)Uploaded byClau Maldo
- Lecture 11Uploaded byJim Demitriyev
- Apress Beginning SQL Server for Developers 4th (2015)Uploaded byQuastor
- Data Structures Objective Questions and Answers _ Set-3 _ SearchcroneUploaded byMultan Singh Bhati
- Computer Notes - Data Structures - 12Uploaded byecomputernotes
- APCS BookUploaded byEdmundo Coup
- Tikz Qtree ManualUploaded byjoebee
- Unit 5finalUploaded byrammar147
- 2b DecisionTheory ModAUploaded byJason Merlin

- 1st Reading Misa Learn RideUploaded byHitesh Mishra
- Hindi Medium 9Science NcertSolutions Chapter 3 Intext Page 40Uploaded byHitesh Mishra
- demand-Notes.docxUploaded byHitesh Mishra
- Chem TestUploaded byHitesh Mishra
- 10 Science NCERT Solutions Hindi Medium Chapter 11 Page 211Uploaded byHitesh Mishra
- Choosing to Two Too Homophones WorksheetUploaded byHitesh Mishra
- Class ChemUploaded byHitesh Mishra
- My Dog 1st Grade ReadingUploaded byHitesh Mishra
- Clever Mr Brown 1st Grade ReadingUploaded byHitesh Mishra
- 10 Science NCERT Solutions Hindi Medium Chapter 11 Page 211Uploaded byHitesh Mishra
- Eng-2Uploaded byHitesh Mishra
- ElectricityUploaded byHitesh Mishra
- 10-Science-NCERT-Solutions-Hindi-Medium-Chapter-11-Page-211.pdfUploaded byHitesh Mishra
- Eco Test PaperUploaded byHitesh Mishra
- Eco SolutionUploaded byHitesh Mishra
- 10577Uploaded byHitesh Mishra
- X-MHSB-EGR-UP1-N001Uploaded bymrinal570
- Error Spotting Capsule 1 in PDF No Sooner... ThanUploaded byKrishnendu MItra
- Retirement and Death of a PartnerUploaded byArunima Jain
- 2017 Syllabus 10 English Language and LiteratureUploaded byHitesh Mishra
- Ets Fss Cbs BcomUploaded byHitesh Mishra
- CBSE Class 12 Economics Full Study Material and Chapter NotesUploaded bysourav kumar ray
- 2016 PRT.pdf-60 (1)Uploaded byHitesh Mishra
- nios 12 maths 1Uploaded byabsmeena
- sent4Uploaded byHitesh Mishra
- 71Uploaded byHitesh Mishra
- b Com (Hons)i Paper IV-business StatisticsUploaded byHitesh Mishra
- 257728767-Important-Theorems-of-Geometry-by-Abhishek-Jain-very-important-for-all-SSC-exams.pdfUploaded byHitesh Mishra
- 10_2005_english_communicative_4 (1).pdfUploaded byHitesh Mishra

- Research paper H.R assignment 2.pdfUploaded byReet Dhaliwal
- DAFTAR PUSTAKAUploaded byAnnisa Savitri
- PTE General Spoken PracticeTest1 L21Uploaded byKelly Kelly
- WPA Poster - Courtney-FinalUploaded byapi-3781744
- Table of Scoring Writing SkillUploaded byHerni Mardalia
- sahilkirpalaniresumeUploaded byapi-381283056
- 18-KEC_B_TECH_2ND_SEM_JUNE-2011_Updated_2[1]Uploaded byTarun Bisht
- syllabus for career prep unit 1Uploaded byapi-269732756
- stuart karas resume completeUploaded byapi-348457644
- Trivum IR-RS232 AdaptorUploaded byCosento B.V.
- CoverUploaded byKristalyn Karen Remigio
- UNLV Student Body President EmailUploaded byAshley Forest
- Research ScheduleUploaded bykogin79
- CACV000251_2015Uploaded bypschil
- Possible Dissertation Defense Questions You Should Be Prepared ForUploaded byVersoza Nel
- Bridenbaugh Great MutationUploaded byOleg Soldat
- LSCM - Executive Program (1yr) - Course OutlineUploaded byFastRider Subnani
- A Definition of Clinical SupervisionUploaded byYurika Sagita Putri
- How to Evaluate Faculty Development (215717348)Uploaded byEDUCAUSE
- bio psy ciaUploaded byanon_776560244
- assessment 2Uploaded byapi-297389221
- DHT-6Uploaded byHEMANTKHERA
- Alternative ReadingsUploaded byElvin Junior
- ReviewerPART2.pdfUploaded byderenz30
- goldsmiths 2018 listUploaded byNicolaTirabasso
- Mind Mapping PaperUploaded bySolihin Ihin
- Koreanadultclasses.docxUploaded bykoreacamp
- 9701_s06_qp_3Uploaded byG M Ali Kawsar
- Scholastic K skills (alphabet & fine motor skills).pdfUploaded byPa Tri Cia
- Dse Eng Talk Dec 18 2014 PptUploaded bySamson Yau