SlideShare a Scribd company logo
1 of 1
Download to read offline
The following methods are commonly used in a dictionary implementation. What is the lowest
time complexity achievable for each method: add(key, value) remove(key) getKeys()
getValues() isEmpty() isFull() size() makeEmpty()
Solution
add (key,value) = O(1)
remove (key) = O(1)
getkeys() = O(log n)
getvalues() = O(log n)
isEmpty() = O(1)
isFull() = O(1)
size() = O(1)
makeEmpty() = O(1)

More Related Content

More from feelingcomputors

Exercise 12-4 Chipotle Mexican Grill began with a single location in .pdf
Exercise 12-4 Chipotle Mexican Grill began with a single location in .pdfExercise 12-4 Chipotle Mexican Grill began with a single location in .pdf
Exercise 12-4 Chipotle Mexican Grill began with a single location in .pdf
feelingcomputors
 
describe two recent scientific research studies and it therapies inv.pdf
describe two recent scientific research studies and it therapies inv.pdfdescribe two recent scientific research studies and it therapies inv.pdf
describe two recent scientific research studies and it therapies inv.pdf
feelingcomputors
 
Android Studio App that lets you upload pictures to the app.Hello,.pdf
Android Studio App that lets you upload pictures to the app.Hello,.pdfAndroid Studio App that lets you upload pictures to the app.Hello,.pdf
Android Studio App that lets you upload pictures to the app.Hello,.pdf
feelingcomputors
 
Willy owns a small chocolate factory, located close to a river that o.pdf
Willy owns a small chocolate factory, located close to a river that o.pdfWilly owns a small chocolate factory, located close to a river that o.pdf
Willy owns a small chocolate factory, located close to a river that o.pdf
feelingcomputors
 
what historical trends have affected the social resposibilites of bu.pdf
what historical trends have affected the social resposibilites of bu.pdfwhat historical trends have affected the social resposibilites of bu.pdf
what historical trends have affected the social resposibilites of bu.pdf
feelingcomputors
 
Tomas is a 4-year-old male who is an only child of two professional .pdf
Tomas is a 4-year-old male who is an only child of two professional .pdfTomas is a 4-year-old male who is an only child of two professional .pdf
Tomas is a 4-year-old male who is an only child of two professional .pdf
feelingcomputors
 
This is a homework assignment that has to be done in JAVA.Objectiv.pdf
This is a homework assignment that has to be done in JAVA.Objectiv.pdfThis is a homework assignment that has to be done in JAVA.Objectiv.pdf
This is a homework assignment that has to be done in JAVA.Objectiv.pdf
feelingcomputors
 

More from feelingcomputors (20)

Exercise 12-4 Chipotle Mexican Grill began with a single location in .pdf
Exercise 12-4 Chipotle Mexican Grill began with a single location in .pdfExercise 12-4 Chipotle Mexican Grill began with a single location in .pdf
Exercise 12-4 Chipotle Mexican Grill began with a single location in .pdf
 
describe two recent scientific research studies and it therapies inv.pdf
describe two recent scientific research studies and it therapies inv.pdfdescribe two recent scientific research studies and it therapies inv.pdf
describe two recent scientific research studies and it therapies inv.pdf
 
Differentiating Events that Occur Before and After Ovulation In the O.pdf
Differentiating Events that Occur Before and After Ovulation In the O.pdfDifferentiating Events that Occur Before and After Ovulation In the O.pdf
Differentiating Events that Occur Before and After Ovulation In the O.pdf
 
Android Studio App that lets you upload pictures to the app.Hello,.pdf
Android Studio App that lets you upload pictures to the app.Hello,.pdfAndroid Studio App that lets you upload pictures to the app.Hello,.pdf
Android Studio App that lets you upload pictures to the app.Hello,.pdf
 
A man starts walking north at 3 fts from a point P. Five minutes la.pdf
A man starts walking north at 3 fts from a point P. Five minutes la.pdfA man starts walking north at 3 fts from a point P. Five minutes la.pdf
A man starts walking north at 3 fts from a point P. Five minutes la.pdf
 
11. Briefly describe the function of the following in protein synthe.pdf
11. Briefly describe the function of the following in protein synthe.pdf11. Briefly describe the function of the following in protein synthe.pdf
11. Briefly describe the function of the following in protein synthe.pdf
 
You save exist1 the first day of the month, exist2 the second day, ex.pdf
You save exist1 the first day of the month, exist2 the second day, ex.pdfYou save exist1 the first day of the month, exist2 the second day, ex.pdf
You save exist1 the first day of the month, exist2 the second day, ex.pdf
 
Willy owns a small chocolate factory, located close to a river that o.pdf
Willy owns a small chocolate factory, located close to a river that o.pdfWilly owns a small chocolate factory, located close to a river that o.pdf
Willy owns a small chocolate factory, located close to a river that o.pdf
 
Which of the following are used as cloning vectors Select all that a.pdf
Which of the following are used as cloning vectors Select all that a.pdfWhich of the following are used as cloning vectors Select all that a.pdf
Which of the following are used as cloning vectors Select all that a.pdf
 
When are bank deposits createdWhen businesses pay wages and salar.pdf
When are bank deposits createdWhen businesses pay wages and salar.pdfWhen are bank deposits createdWhen businesses pay wages and salar.pdf
When are bank deposits createdWhen businesses pay wages and salar.pdf
 
what historical trends have affected the social resposibilites of bu.pdf
what historical trends have affected the social resposibilites of bu.pdfwhat historical trends have affected the social resposibilites of bu.pdf
what historical trends have affected the social resposibilites of bu.pdf
 
What are some alternate perspectives that HRM professionals may purs.pdf
What are some alternate perspectives that HRM professionals may purs.pdfWhat are some alternate perspectives that HRM professionals may purs.pdf
What are some alternate perspectives that HRM professionals may purs.pdf
 
view the media release by Phillip Lowe, the Governor of the RBA and a.pdf
view the media release by Phillip Lowe, the Governor of the RBA and a.pdfview the media release by Phillip Lowe, the Governor of the RBA and a.pdf
view the media release by Phillip Lowe, the Governor of the RBA and a.pdf
 
Tomas is a 4-year-old male who is an only child of two professional .pdf
Tomas is a 4-year-old male who is an only child of two professional .pdfTomas is a 4-year-old male who is an only child of two professional .pdf
Tomas is a 4-year-old male who is an only child of two professional .pdf
 
This is a homework assignment that has to be done in JAVA.Objectiv.pdf
This is a homework assignment that has to be done in JAVA.Objectiv.pdfThis is a homework assignment that has to be done in JAVA.Objectiv.pdf
This is a homework assignment that has to be done in JAVA.Objectiv.pdf
 
The process by which the bureaucracy produces what is effectively le.pdf
The process by which the bureaucracy produces what is effectively le.pdfThe process by which the bureaucracy produces what is effectively le.pdf
The process by which the bureaucracy produces what is effectively le.pdf
 
5. Mickey borrowed $11,300 from Donald on Dec, 4, 2012 and agreed to.pdf
5. Mickey borrowed $11,300 from Donald on Dec, 4, 2012 and agreed to.pdf5. Mickey borrowed $11,300 from Donald on Dec, 4, 2012 and agreed to.pdf
5. Mickey borrowed $11,300 from Donald on Dec, 4, 2012 and agreed to.pdf
 
The can counting program of Figure 8-9 is described in the text. Prep.pdf
The can counting program of Figure 8-9 is described in the text. Prep.pdfThe can counting program of Figure 8-9 is described in the text. Prep.pdf
The can counting program of Figure 8-9 is described in the text. Prep.pdf
 
The first table that follows shows government expenditures as a perce.pdf
The first table that follows shows government expenditures as a perce.pdfThe first table that follows shows government expenditures as a perce.pdf
The first table that follows shows government expenditures as a perce.pdf
 
Submit a paragraph on a particular culture of people which have made.pdf
Submit a paragraph on a particular culture of people which have made.pdfSubmit a paragraph on a particular culture of people which have made.pdf
Submit a paragraph on a particular culture of people which have made.pdf
 

Recently uploaded

Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 
Orientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfOrientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdf
Elizabeth Walsh
 

Recently uploaded (20)

Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Orientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfOrientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdf
 
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptxMichaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 

The following methods are commonly used in a dictionary implementatio.pdf

  • 1. The following methods are commonly used in a dictionary implementation. What is the lowest time complexity achievable for each method: add(key, value) remove(key) getKeys() getValues() isEmpty() isFull() size() makeEmpty() Solution add (key,value) = O(1) remove (key) = O(1) getkeys() = O(log n) getvalues() = O(log n) isEmpty() = O(1) isFull() = O(1) size() = O(1) makeEmpty() = O(1)