SlideShare a Scribd company logo
1 of 36
4 장  ADT Unsorted List( 비정렬 리스트 )
List Definitions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
List Definitions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
List Definitions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Abstract Data Type (ADT)   ,[object Object],[object Object],[object Object]
4 Basic Kinds of ADT Operations ,[object Object],[object Object],[object Object],[object Object],[object Object]
ADT Unsorted List Operations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],change state observe state process all
ADT 와  C++  클래스 ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],struct ItemType { … . KeyType key; … };
[object Object],[object Object],[object Object],[object Object],구현  ( IMPLEMENTATION )
[object Object],[object Object],[object Object],ADT ADT Unsorted List  구현 Public declarations are the same for different  implementations; only private data changes
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],ADT ADT Unsorted List  배열 구현 struct ItemType { … . KeyType key; … };
배열 구현 ,[object Object],[object Object]
Class Constructor   ,[object Object],[object Object]
Class Constructor Rules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Class Interface Diagram UnsortedType class IsFull LengthIs  ResetList DeleteItem InsertItem UnsortedType RetrieveItem GetNextItem IsEmpty Private data: length info  [ 0 ] [ 1 ] [ 2 ] [MAX_ITEMS-1] currentPos
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],멤버 함수 구현
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],observers
InsertItem length   3 info   [ 0 ]  Maxwell [ 1 ]  Bradley   [ 2 ]    Asad   [ 3 ]      .   .   .   [MAX_ITEMS-1] If the list is unsorted,  where should “Hsing” go? insert("Hsing");
InsertItem length   4 info   [ 0 ]  Maxwell [ 1 ]  Bradley   [ 2 ]    Asad   [ 3 ]    Hsing   .   .   [MAX_ITEMS-1] That was easy! Can you code it?
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DeleteItem: before the operation location:  0  Delete Bradley length   4 info   [ 0 ]  Maxwell [ 1 ]  Bradley   [ 2 ]    Asad   [ 3 ]    Hsing   .   .   .   [MAX_ITEMS-1]
DeleteItem: Finding the item  location:  1  Key Bradley has been matched length   4 info   [ 0 ]  Maxwell [ 1 ]  Bradley   [ 2 ]    Asad   [ 3 ]    Hsing   .   .   .   [MAX_ITEMS-1]
DeleteItem: after the operation  location:  1  length   3 info   [ 0 ]  Maxwell [ 1 ]  Hsing   [ 2 ]    Asad   [ 3 ]    Hsing   .   .   .   [MAX_ITEMS-1] * Copy last list element to where key “Bradley” was before *  length  has been decremented
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Iterators
Application Level ,[object Object],[object Object],[object Object],[object Object]
Application Level ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Order of Magnitude of a Function ,[object Object],[object Object],[object Object],[object Object]
Names of Orders of Magnitude ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Story of Big O ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Algorithm Growth Rates Figure  Time requirements as a function of the problem size  n ,[object Object],[object Object],[object Object]
Big-O Comparison of List Operations ,[object Object],OPERATION   UnsortedList 의 배열구현 RetrieveItem  O(N) InsertItem Find   O(1) Put  O(1) Combined  O(1) DeleteItem Find  O(N) Put  O(1) swap Combined  O(N)

More Related Content

What's hot (20)

Classes & objects new
Classes & objects newClasses & objects new
Classes & objects new
 
Creating classes and applications in java
Creating classes and applications in javaCreating classes and applications in java
Creating classes and applications in java
 
Chapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIChapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part II
 
Class or Object
Class or ObjectClass or Object
Class or Object
 
Class and object in c++
Class and object in c++Class and object in c++
Class and object in c++
 
Object and class
Object and classObject and class
Object and class
 
Oop
OopOop
Oop
 
11 Using classes and objects
11 Using classes and objects11 Using classes and objects
11 Using classes and objects
 
Wrapper class
Wrapper classWrapper class
Wrapper class
 
Oop concepts in python
Oop concepts in pythonOop concepts in python
Oop concepts in python
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Introduction to OO Perl with Moose
Introduction to OO Perl with MooseIntroduction to OO Perl with Moose
Introduction to OO Perl with Moose
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
ccc
cccccc
ccc
 
Computer Programming 2
Computer Programming 2 Computer Programming 2
Computer Programming 2
 
C++ And Object in lecture3
C++  And Object in lecture3C++  And Object in lecture3
C++ And Object in lecture3
 
Dive into Python Class
Dive into Python ClassDive into Python Class
Dive into Python Class
 
Introduction to javascript and yoolkui
Introduction to javascript and yoolkuiIntroduction to javascript and yoolkui
Introduction to javascript and yoolkui
 
Object oriented design
Object oriented designObject oriented design
Object oriented design
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
 

Viewers also liked

[Globant summer take over] Empowering Big Data with Cassandra
[Globant summer take over] Empowering Big Data with Cassandra[Globant summer take over] Empowering Big Data with Cassandra
[Globant summer take over] Empowering Big Data with CassandraGlobant
 
Integrating Webtools for Performance-based Chinese Classroom
Integrating Webtools for Performance-based Chinese ClassroomIntegrating Webtools for Performance-based Chinese Classroom
Integrating Webtools for Performance-based Chinese ClassroomJoanne Shang
 
Employability deciding-planning and competing
Employability  deciding-planning and competingEmployability  deciding-planning and competing
Employability deciding-planning and competingGraduates Yorkshire
 
Regulatory challenges associated with the rapid spread of health markets
Regulatory challenges associated with the rapid spread of health marketsRegulatory challenges associated with the rapid spread of health markets
Regulatory challenges associated with the rapid spread of health marketsJeff Knezovich
 
E ticaret konferansı- 7 mayıs2015
E ticaret konferansı- 7 mayıs2015E ticaret konferansı- 7 mayıs2015
E ticaret konferansı- 7 mayıs2015Mustafa Kuğu
 
Some photos from the delegation chapter 2011
Some photos from the delegation chapter 2011Some photos from the delegation chapter 2011
Some photos from the delegation chapter 2011Simona Vacchieri
 
El motor de combustio interna: conceptes fonamentals
El motor de combustio interna: conceptes fonamentalsEl motor de combustio interna: conceptes fonamentals
El motor de combustio interna: conceptes fonamentalschoriol
 
Facebook News Feed 101
Facebook News Feed 101Facebook News Feed 101
Facebook News Feed 101Golin
 
Using Photoshop Better
Using Photoshop BetterUsing Photoshop Better
Using Photoshop BetterDavid Eldridge
 
アジア発のスマートメッセージコミュニケーション潮流は世界を刺激するのか?
アジア発のスマートメッセージコミュニケーション潮流は世界を刺激するのか?アジア発のスマートメッセージコミュニケーション潮流は世界を刺激するのか?
アジア発のスマートメッセージコミュニケーション潮流は世界を刺激するのか?LinkaziaJapan.co.,Ltd
 
Avoiding ADHD: Engaging Consumers in a Multi-Screen World
Avoiding ADHD: Engaging Consumers in a Multi-Screen WorldAvoiding ADHD: Engaging Consumers in a Multi-Screen World
Avoiding ADHD: Engaging Consumers in a Multi-Screen Worldcd3c
 
Javascripでオブジェクト指向
Javascripでオブジェクト指向Javascripでオブジェクト指向
Javascripでオブジェクト指向1000 VICKY
 
Molaya kgosi HerStory
Molaya kgosi HerStoryMolaya kgosi HerStory
Molaya kgosi HerStoryBogolo Ken
 
Turkcell Enerji İzleme Dündar Özdemir
Turkcell Enerji İzleme Dündar ÖzdemirTurkcell Enerji İzleme Dündar Özdemir
Turkcell Enerji İzleme Dündar ÖzdemirMustafa Kuğu
 

Viewers also liked (20)

Startup tour so-l
Startup tour so-lStartup tour so-l
Startup tour so-l
 
[Globant summer take over] Empowering Big Data with Cassandra
[Globant summer take over] Empowering Big Data with Cassandra[Globant summer take over] Empowering Big Data with Cassandra
[Globant summer take over] Empowering Big Data with Cassandra
 
Integrating Webtools for Performance-based Chinese Classroom
Integrating Webtools for Performance-based Chinese ClassroomIntegrating Webtools for Performance-based Chinese Classroom
Integrating Webtools for Performance-based Chinese Classroom
 
Employability deciding-planning and competing
Employability  deciding-planning and competingEmployability  deciding-planning and competing
Employability deciding-planning and competing
 
Responding to objection
Responding to objectionResponding to objection
Responding to objection
 
Regulatory challenges associated with the rapid spread of health markets
Regulatory challenges associated with the rapid spread of health marketsRegulatory challenges associated with the rapid spread of health markets
Regulatory challenges associated with the rapid spread of health markets
 
E ticaret konferansı- 7 mayıs2015
E ticaret konferansı- 7 mayıs2015E ticaret konferansı- 7 mayıs2015
E ticaret konferansı- 7 mayıs2015
 
David
DavidDavid
David
 
Some photos from the delegation chapter 2011
Some photos from the delegation chapter 2011Some photos from the delegation chapter 2011
Some photos from the delegation chapter 2011
 
El motor de combustio interna: conceptes fonamentals
El motor de combustio interna: conceptes fonamentalsEl motor de combustio interna: conceptes fonamentals
El motor de combustio interna: conceptes fonamentals
 
Boletin bibliografico 3º trimestre
Boletin bibliografico 3º trimestreBoletin bibliografico 3º trimestre
Boletin bibliografico 3º trimestre
 
Facebook News Feed 101
Facebook News Feed 101Facebook News Feed 101
Facebook News Feed 101
 
Using Photoshop Better
Using Photoshop BetterUsing Photoshop Better
Using Photoshop Better
 
アジア発のスマートメッセージコミュニケーション潮流は世界を刺激するのか?
アジア発のスマートメッセージコミュニケーション潮流は世界を刺激するのか?アジア発のスマートメッセージコミュニケーション潮流は世界を刺激するのか?
アジア発のスマートメッセージコミュニケーション潮流は世界を刺激するのか?
 
Avoiding ADHD: Engaging Consumers in a Multi-Screen World
Avoiding ADHD: Engaging Consumers in a Multi-Screen WorldAvoiding ADHD: Engaging Consumers in a Multi-Screen World
Avoiding ADHD: Engaging Consumers in a Multi-Screen World
 
Javascripでオブジェクト指向
Javascripでオブジェクト指向Javascripでオブジェクト指向
Javascripでオブジェクト指向
 
Get your house on order
Get your house on orderGet your house on order
Get your house on order
 
Molaya kgosi HerStory
Molaya kgosi HerStoryMolaya kgosi HerStory
Molaya kgosi HerStory
 
Turkcell Enerji İzleme Dündar Özdemir
Turkcell Enerji İzleme Dündar ÖzdemirTurkcell Enerji İzleme Dündar Özdemir
Turkcell Enerji İzleme Dündar Özdemir
 
Bash script final
Bash script finalBash script final
Bash script final
 

Similar to 강의자료6

BackgroundIn many applications, the composition of a collection o.pdf
BackgroundIn many applications, the composition of a collection o.pdfBackgroundIn many applications, the composition of a collection o.pdf
BackgroundIn many applications, the composition of a collection o.pdfmayorothenguyenhob69
 
Using the C++ programming language1. Implement the UnsortedList cl.pdf
Using the C++ programming language1. Implement the UnsortedList cl.pdfUsing the C++ programming language1. Implement the UnsortedList cl.pdf
Using the C++ programming language1. Implement the UnsortedList cl.pdfmallik3000
 
C++ detyrat postim_slideshare
C++ detyrat postim_slideshareC++ detyrat postim_slideshare
C++ detyrat postim_slidesharetctal
 
Implement the ListArray ADT-Implement the following operations.pdf
Implement the ListArray ADT-Implement the following operations.pdfImplement the ListArray ADT-Implement the following operations.pdf
Implement the ListArray ADT-Implement the following operations.pdfpetercoiffeur18
 
(Unordered Sets) As explained in this chapter, a set is a collection.pdf
(Unordered Sets) As explained in this chapter, a set is a collection.pdf(Unordered Sets) As explained in this chapter, a set is a collection.pdf
(Unordered Sets) As explained in this chapter, a set is a collection.pdfssuserc77a341
 
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdfarshin9
 
All code should be in C++Using the UnsortedList class (UnsortedLis.pdf
All code should be in C++Using the UnsortedList class (UnsortedLis.pdfAll code should be in C++Using the UnsortedList class (UnsortedLis.pdf
All code should be in C++Using the UnsortedList class (UnsortedLis.pdfakashenterprises93
 
written in c- please answer the 4 questions and write the functions ba.pdf
written in c- please answer the 4 questions and write the functions ba.pdfwritten in c- please answer the 4 questions and write the functions ba.pdf
written in c- please answer the 4 questions and write the functions ba.pdfsravi07
 
Written in C- requires linked lists- Please answer the 4 questions and.pdf
Written in C- requires linked lists- Please answer the 4 questions and.pdfWritten in C- requires linked lists- Please answer the 4 questions and.pdf
Written in C- requires linked lists- Please answer the 4 questions and.pdfsravi07
 
Written in C- requires linked lists- Please answer the 4 questions and (1).pdf
Written in C- requires linked lists- Please answer the 4 questions and (1).pdfWritten in C- requires linked lists- Please answer the 4 questions and (1).pdf
Written in C- requires linked lists- Please answer the 4 questions and (1).pdfsravi07
 
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdfganisyedtrd
 
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...davidwarner122
 
Write a program to find the number of comparisons using the binary se.docx
 Write a program to find the number of comparisons using the binary se.docx Write a program to find the number of comparisons using the binary se.docx
Write a program to find the number of comparisons using the binary se.docxajoy21
 
-- Reminder that your file name is incredibly important- Please do not.docx
-- Reminder that your file name is incredibly important- Please do not.docx-- Reminder that your file name is incredibly important- Please do not.docx
-- Reminder that your file name is incredibly important- Please do not.docxAdamq0DJonese
 
please follow all instructions and answer the inbedded questions- and.pdf
please follow all instructions and answer the inbedded questions- and.pdfplease follow all instructions and answer the inbedded questions- and.pdf
please follow all instructions and answer the inbedded questions- and.pdfIan5L3Allanm
 
#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx
#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx
#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docxajoy21
 

Similar to 강의자료6 (20)

강의자료10
강의자료10강의자료10
강의자료10
 
BackgroundIn many applications, the composition of a collection o.pdf
BackgroundIn many applications, the composition of a collection o.pdfBackgroundIn many applications, the composition of a collection o.pdf
BackgroundIn many applications, the composition of a collection o.pdf
 
Using the C++ programming language1. Implement the UnsortedList cl.pdf
Using the C++ programming language1. Implement the UnsortedList cl.pdfUsing the C++ programming language1. Implement the UnsortedList cl.pdf
Using the C++ programming language1. Implement the UnsortedList cl.pdf
 
Unsorted Sorted List_Array.pptx
Unsorted Sorted List_Array.pptxUnsorted Sorted List_Array.pptx
Unsorted Sorted List_Array.pptx
 
C++ detyrat postim_slideshare
C++ detyrat postim_slideshareC++ detyrat postim_slideshare
C++ detyrat postim_slideshare
 
Adt of lists
Adt of listsAdt of lists
Adt of lists
 
Implement the ListArray ADT-Implement the following operations.pdf
Implement the ListArray ADT-Implement the following operations.pdfImplement the ListArray ADT-Implement the following operations.pdf
Implement the ListArray ADT-Implement the following operations.pdf
 
(Unordered Sets) As explained in this chapter, a set is a collection.pdf
(Unordered Sets) As explained in this chapter, a set is a collection.pdf(Unordered Sets) As explained in this chapter, a set is a collection.pdf
(Unordered Sets) As explained in this chapter, a set is a collection.pdf
 
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
 
All code should be in C++Using the UnsortedList class (UnsortedLis.pdf
All code should be in C++Using the UnsortedList class (UnsortedLis.pdfAll code should be in C++Using the UnsortedList class (UnsortedLis.pdf
All code should be in C++Using the UnsortedList class (UnsortedLis.pdf
 
Groovy
GroovyGroovy
Groovy
 
written in c- please answer the 4 questions and write the functions ba.pdf
written in c- please answer the 4 questions and write the functions ba.pdfwritten in c- please answer the 4 questions and write the functions ba.pdf
written in c- please answer the 4 questions and write the functions ba.pdf
 
Written in C- requires linked lists- Please answer the 4 questions and.pdf
Written in C- requires linked lists- Please answer the 4 questions and.pdfWritten in C- requires linked lists- Please answer the 4 questions and.pdf
Written in C- requires linked lists- Please answer the 4 questions and.pdf
 
Written in C- requires linked lists- Please answer the 4 questions and (1).pdf
Written in C- requires linked lists- Please answer the 4 questions and (1).pdfWritten in C- requires linked lists- Please answer the 4 questions and (1).pdf
Written in C- requires linked lists- Please answer the 4 questions and (1).pdf
 
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
 
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...Below is a given ArrayList class and Main class  Your Dreams Our Mission/tuto...
Below is a given ArrayList class and Main class Your Dreams Our Mission/tuto...
 
Write a program to find the number of comparisons using the binary se.docx
 Write a program to find the number of comparisons using the binary se.docx Write a program to find the number of comparisons using the binary se.docx
Write a program to find the number of comparisons using the binary se.docx
 
-- Reminder that your file name is incredibly important- Please do not.docx
-- Reminder that your file name is incredibly important- Please do not.docx-- Reminder that your file name is incredibly important- Please do not.docx
-- Reminder that your file name is incredibly important- Please do not.docx
 
please follow all instructions and answer the inbedded questions- and.pdf
please follow all instructions and answer the inbedded questions- and.pdfplease follow all instructions and answer the inbedded questions- and.pdf
please follow all instructions and answer the inbedded questions- and.pdf
 
#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx
#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx
#ifndef MYLIST_H_ #define MYLIST_H_#includeiostream #include.docx
 

More from Young Wook Kim

More from Young Wook Kim (6)

강의자료8
강의자료8강의자료8
강의자료8
 
C review
C  reviewC  review
C review
 
강의자료4
강의자료4강의자료4
강의자료4
 
강의자료3
강의자료3강의자료3
강의자료3
 
강의자료 2
강의자료 2강의자료 2
강의자료 2
 
강의자료5
강의자료5강의자료5
강의자료5
 

강의자료6

  • 1. 4 장 ADT Unsorted List( 비정렬 리스트 )
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. Class Interface Diagram UnsortedType class IsFull LengthIs ResetList DeleteItem InsertItem UnsortedType RetrieveItem GetNextItem IsEmpty Private data: length info [ 0 ] [ 1 ] [ 2 ] [MAX_ITEMS-1] currentPos
  • 17.
  • 18.
  • 19. InsertItem length 3 info [ 0 ] Maxwell [ 1 ] Bradley [ 2 ] Asad [ 3 ] . . . [MAX_ITEMS-1] If the list is unsorted, where should “Hsing” go? insert("Hsing");
  • 20. InsertItem length 4 info [ 0 ] Maxwell [ 1 ] Bradley [ 2 ] Asad [ 3 ] Hsing . . [MAX_ITEMS-1] That was easy! Can you code it?
  • 21.
  • 22.
  • 23.
  • 24. DeleteItem: before the operation location: 0 Delete Bradley length 4 info [ 0 ] Maxwell [ 1 ] Bradley [ 2 ] Asad [ 3 ] Hsing . . . [MAX_ITEMS-1]
  • 25. DeleteItem: Finding the item location: 1 Key Bradley has been matched length 4 info [ 0 ] Maxwell [ 1 ] Bradley [ 2 ] Asad [ 3 ] Hsing . . . [MAX_ITEMS-1]
  • 26. DeleteItem: after the operation location: 1 length 3 info [ 0 ] Maxwell [ 1 ] Hsing [ 2 ] Asad [ 3 ] Hsing . . . [MAX_ITEMS-1] * Copy last list element to where key “Bradley” was before * length has been decremented
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.

Editor's Notes

  1. switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } ound
  2. switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } ound
  3. switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } ound
  4. switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } ound
  5. switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } ound
  6. switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } switch ( item.ComparedTo( info[location] ) ) { case LESS : case GREATER : location++ ; moreToSearch = ( location < length ) ; case EQUAL : found = true ; item = info[ location ] ; break ; } ound