SlideShare a Scribd company logo
1 of 21
Download to read offline
Prog_2 course- 2014 
2 bytes team 
Kinan keshkeh 
IT Engineering-Damascus University 
3rd year
Double Lists 
Data 
next 
prev 
L_S 
Data 
next 
prev 
Data 
prev 
prev 
next 
next 
Data 
L_E
Definition 
Type 
D_P = ^D_R; 
D_R = Record 
ID:integer; 
next:D_P; 
prev:D_P; 
end; 
var 
L_S, L_E : D_P;
Double Lists Procedures: 
1) Insert a Node 
2) Delete a Node 
3) Search Node
Insert a Node 
Data 
next 
prev 
Data 
next 
prev 
Data 
next 
prev 
Data 
next 
prev 
L_E 
Data 
next 
prev 
L_S 
Temp
1) 
L_S 
Nil 
15 
next 
prev 
Temp 
L_E
3 
next 
prev 
20 
next 
prev 
15 
next 
prev 
2) 
L_S 
S 
L_E 
Temp
3 
next 
prev 
20 
next 
prev 
15 
next 
prev 
3) 
L_S 
S 
L_E 
2 
next 
prev 
Temp
3 
next 
prev 
20 
next 
prev 
15 
next 
prev 
L_S 
S 
L_E 
2 
next 
prev 
Nil 
4) 
Temp
procedure D_L_Insert ( var L_S, L_E: D_P; KEY:integer); 
var 
Temp , S : D_P; 
Located: Boolean; 
begin 
new(Temp); 
temp^.ID:=KEY; 
temp^.next:=nil; 
temp^.prev:=nil; 
15 
next 
prev 
Temp
If L_S=nil then 
begin 
L_S:=Temp; 
L_E:=Temp; 
end 
Else 
begin 
S:=L_S; 
Located:=False; 
while (S<>nil) and (not Located) do 
if S^.id < key then 
S:=S^.next 
else 
Located:=True; 
Temp^.next:=S; 
+2 points
If S=L_S then 
begin 
L_S^.prev:=Temp; 
L_S:=Temp; 
end 
Else if S=nil then 
begin 
Temp^.prev := L_E; 
L_E^.next := Temp; 
L_E:=Temp; 
end 
Else 
begin 
Temp^.prev := S^.prev; 
S^.prev^.next := Temp; 
S^.prev := Temp; 
end; 
end; 
end; {procedure}
1) 
L_S 
Nil 
Delete a Node 
flag 
3 
L_E
3 
next 
prev 
20 
next 
prev 
15 
next 
prev 
L_S 
L_E 
key 
3 
2) 
temp 
3 
next 
prev 
L_S 
Nil 
temp 
L_E 
flag 
2
3 
next 
prev 
20 
next 
prev 
15 
next 
prev 
L_S 
L_E 
temp 
3) 
falg 
2 
key 
20
3 
next 
prev 
20 
next 
prev 
15 
next 
prev 
L_S 
L_E 
4) 
flag 
2 
key 
15 
S
3 
next 
prev 
20 
next 
prev 
15 
next 
prev 
L_S 
L_E 
Nil 
flag 
1 
key 
99 
5) 
S
procedure D_L_Delete ( var L_S,L_E: D_P; KEY:integer; var flag :char); 
var 
Temp , S:D_P; 
begin 
If L_S=nil then 
flag:=‘3’ 
Else if KEY =L_S^.id then 
begin 
Temp:=L_S; 
L_S:=L_S^.next; ls^.prev:=nill ; 
Dispose(Temp); 
flag:=‘2’; 
If L_s=nil then 
L_E:=nil; 
Else 
L_s^.prev:=nil; 
end
Else if KEY = L_E^.id then 
begin 
Temp:=L_E; 
L_E:=L_E^.prev; L_E^.next:=nil; Dispose(Temp); 
Flag:=‘2’; 
end 
Else 
begin 
S:=L_S; 
while (S<>nil) and (S^.id <> KEY ) do 
S:=S^.next; 
if S=nil then 
flag:=‘1’; 
else 
begin 
S^.next^.prev:=S^.prev; 
S^.prev^.next:=S^.next; Dispose(S); 
flag:=‘ 2 ’; 
end; 
end; 
end; {procedure}
Homework: 
+15 points 
اكتب اجرائية البحث عه عنصر ما في سلسة مترابطة 
مه طرفيه : 
Search( var L_s, L_E : D_P ; Key:integer; 
var p: D_P ; var flag: char); 
بحيث تحفظ الاجرائية مؤشر على مكان العنصر المراد, 
وتعيد محرف يعبر عه حالة البحث ) فشل-وجد العنصر- 
السلسلة فارغة(
Group : group link 
Mobile phone- Kinan : 0994385748 
Facebook account : kinan’s account 
2 bytes team

More Related Content

What's hot

Suffix Array 構築方法の紹介
Suffix Array 構築方法の紹介Suffix Array 構築方法の紹介
Suffix Array 構築方法の紹介Takashi Hoshino
 
Hello, Type Systems! - Introduction to Featherweight Java
Hello, Type Systems! - Introduction to Featherweight JavaHello, Type Systems! - Introduction to Featherweight Java
Hello, Type Systems! - Introduction to Featherweight Javay_taka_23
 
Promise of an API
Promise of an APIPromise of an API
Promise of an APIMaxim Zaks
 
Lisp programming
Lisp programmingLisp programming
Lisp programmingilias ahmed
 
New microsoft office word document (2)
New microsoft office word document (2)New microsoft office word document (2)
New microsoft office word document (2)Syed Umair
 
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...AAKASH KUMAR
 
Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Dr. Loganathan R
 
array, function, pointer, pattern matching
array, function, pointer, pattern matchingarray, function, pointer, pattern matching
array, function, pointer, pattern matchingShakila Mahjabin
 
Asymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using CAsymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using CMeghaj Mallick
 

What's hot (12)

Suffix Array 構築方法の紹介
Suffix Array 構築方法の紹介Suffix Array 構築方法の紹介
Suffix Array 構築方法の紹介
 
Hello, Type Systems! - Introduction to Featherweight Java
Hello, Type Systems! - Introduction to Featherweight JavaHello, Type Systems! - Introduction to Featherweight Java
Hello, Type Systems! - Introduction to Featherweight Java
 
Ch17
Ch17Ch17
Ch17
 
Promise of an API
Promise of an APIPromise of an API
Promise of an API
 
Lisp programming
Lisp programmingLisp programming
Lisp programming
 
New microsoft office word document (2)
New microsoft office word document (2)New microsoft office word document (2)
New microsoft office word document (2)
 
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
 
8.2
8.28.2
8.2
 
Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4
 
array, function, pointer, pattern matching
array, function, pointer, pattern matchingarray, function, pointer, pattern matching
array, function, pointer, pattern matching
 
Asymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using CAsymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using C
 
Periodic pattern mining
Periodic pattern miningPeriodic pattern mining
Periodic pattern mining
 

Viewers also liked

2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked list2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked listkinan keshkeh
 
New Orleans: Nature, Culture and the City
New Orleans: Nature, Culture and the CityNew Orleans: Nature, Culture and the City
New Orleans: Nature, Culture and the Cityholzknj
 
Ppt mediasi bab kerukunan (shinta ariyana pratiwi 021)
Ppt mediasi bab kerukunan (shinta ariyana pratiwi 021)Ppt mediasi bab kerukunan (shinta ariyana pratiwi 021)
Ppt mediasi bab kerukunan (shinta ariyana pratiwi 021)aniseka
 
Apuntes funciones 1º bach míos
Apuntes funciones 1º bach   míosApuntes funciones 1º bach   míos
Apuntes funciones 1º bach míosmgarmon965
 
Finca Kosovo - The recommendation Letter from ICM
Finca Kosovo - The recommendation Letter  from ICMFinca Kosovo - The recommendation Letter  from ICM
Finca Kosovo - The recommendation Letter from ICMFidan Rasimi
 

Viewers also liked (7)

2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked list2Bytesprog2 course_2014_c6_single linked list
2Bytesprog2 course_2014_c6_single linked list
 
New Orleans: Nature, Culture and the City
New Orleans: Nature, Culture and the CityNew Orleans: Nature, Culture and the City
New Orleans: Nature, Culture and the City
 
E learning y b-learning
E learning y b-learningE learning y b-learning
E learning y b-learning
 
Ppt mediasi bab kerukunan (shinta ariyana pratiwi 021)
Ppt mediasi bab kerukunan (shinta ariyana pratiwi 021)Ppt mediasi bab kerukunan (shinta ariyana pratiwi 021)
Ppt mediasi bab kerukunan (shinta ariyana pratiwi 021)
 
Farmacología ginecólogica
Farmacología ginecólogica Farmacología ginecólogica
Farmacología ginecólogica
 
Apuntes funciones 1º bach míos
Apuntes funciones 1º bach   míosApuntes funciones 1º bach   míos
Apuntes funciones 1º bach míos
 
Finca Kosovo - The recommendation Letter from ICM
Finca Kosovo - The recommendation Letter  from ICMFinca Kosovo - The recommendation Letter  from ICM
Finca Kosovo - The recommendation Letter from ICM
 

Similar to 2Bytesprog2 course_2014_c7_double_lists

Double linked list c8
Double linked list c8Double linked list c8
Double linked list c8Omar Al-Sabek
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptxKokilaK25
 
12IRGeneration.pdf
12IRGeneration.pdf12IRGeneration.pdf
12IRGeneration.pdfSHUJEHASSAN
 
Please finish the int LLInsert function.typedef struct STUDENT {.pdf
Please finish the int LLInsert function.typedef struct STUDENT {.pdfPlease finish the int LLInsert function.typedef struct STUDENT {.pdf
Please finish the int LLInsert function.typedef struct STUDENT {.pdffortmdu
 
Chapter Eight(2)
Chapter Eight(2)Chapter Eight(2)
Chapter Eight(2)bolovv
 
Generating code from dags
Generating code from dagsGenerating code from dags
Generating code from dagsindhu mathi
 
The TclQuadcode Compiler
The TclQuadcode CompilerThe TclQuadcode Compiler
The TclQuadcode CompilerDonal Fellows
 
TableDrivenProg_20160714
TableDrivenProg_20160714TableDrivenProg_20160714
TableDrivenProg_20160714Teddy Hsiung
 
Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisEuclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisAmrinder Arora
 
Digital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDLDigital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDLOmkar Rane
 
Keypad and dc motor
Keypad and dc motor Keypad and dc motor
Keypad and dc motor vijaydeepakg
 

Similar to 2Bytesprog2 course_2014_c7_double_lists (17)

Double linked list c8
Double linked list c8Double linked list c8
Double linked list c8
 
Ch8a
Ch8aCh8a
Ch8a
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptx
 
12IRGeneration.pdf
12IRGeneration.pdf12IRGeneration.pdf
12IRGeneration.pdf
 
Please finish the int LLInsert function.typedef struct STUDENT {.pdf
Please finish the int LLInsert function.typedef struct STUDENT {.pdfPlease finish the int LLInsert function.typedef struct STUDENT {.pdf
Please finish the int LLInsert function.typedef struct STUDENT {.pdf
 
Linked lists c7
Linked lists c7Linked lists c7
Linked lists c7
 
Chapter Eight(2)
Chapter Eight(2)Chapter Eight(2)
Chapter Eight(2)
 
Ch8b
Ch8bCh8b
Ch8b
 
Generating code from dags
Generating code from dagsGenerating code from dags
Generating code from dags
 
The TclQuadcode Compiler
The TclQuadcode CompilerThe TclQuadcode Compiler
The TclQuadcode Compiler
 
TableDrivenProg_20160714
TableDrivenProg_20160714TableDrivenProg_20160714
TableDrivenProg_20160714
 
Verilog_Examples (1).pdf
Verilog_Examples (1).pdfVerilog_Examples (1).pdf
Verilog_Examples (1).pdf
 
Big O Notation.ppt
Big O Notation.pptBig O Notation.ppt
Big O Notation.ppt
 
Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisEuclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
 
Plsql programs
Plsql programsPlsql programs
Plsql programs
 
Digital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDLDigital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDL
 
Keypad and dc motor
Keypad and dc motor Keypad and dc motor
Keypad and dc motor
 

More from kinan keshkeh

10 Little Tricks to Get Your Class’s Attention (and Hold It)
10 Little Tricks to Get Your  Class’s Attention (and Hold It)10 Little Tricks to Get Your  Class’s Attention (and Hold It)
10 Little Tricks to Get Your Class’s Attention (and Hold It)kinan keshkeh
 
Simpson and lagranje dalambair math methods
Simpson and lagranje dalambair math methods Simpson and lagranje dalambair math methods
Simpson and lagranje dalambair math methods kinan keshkeh
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptkinan keshkeh
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptkinan keshkeh
 
GeneticAlgorithms_AND_CuttingWoodAlgorithm
GeneticAlgorithms_AND_CuttingWoodAlgorithm  GeneticAlgorithms_AND_CuttingWoodAlgorithm
GeneticAlgorithms_AND_CuttingWoodAlgorithm kinan keshkeh
 
Algorithm in discovering and correcting words errors in a dictionary or any w...
Algorithm in discovering and correcting words errors in a dictionary or any w...Algorithm in discovering and correcting words errors in a dictionary or any w...
Algorithm in discovering and correcting words errors in a dictionary or any w...kinan keshkeh
 
2Bytesprog2 course_2014_c9_graph
2Bytesprog2 course_2014_c9_graph2Bytesprog2 course_2014_c9_graph
2Bytesprog2 course_2014_c9_graphkinan keshkeh
 
2Bytesprog2 course_2014_c8_units
2Bytesprog2 course_2014_c8_units2Bytesprog2 course_2014_c8_units
2Bytesprog2 course_2014_c8_unitskinan keshkeh
 
2Bytesprog2 course_2014_c4_binaryfiles
2Bytesprog2 course_2014_c4_binaryfiles2Bytesprog2 course_2014_c4_binaryfiles
2Bytesprog2 course_2014_c4_binaryfileskinan keshkeh
 
2Bytesprog2 course_2014_c3_txtfiles
2Bytesprog2 course_2014_c3_txtfiles2Bytesprog2 course_2014_c3_txtfiles
2Bytesprog2 course_2014_c3_txtfileskinan keshkeh
 
2Bytesprog2 course_2014_c2_records
2Bytesprog2 course_2014_c2_records2Bytesprog2 course_2014_c2_records
2Bytesprog2 course_2014_c2_recordskinan keshkeh
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_setskinan keshkeh
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_setskinan keshkeh
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_setskinan keshkeh
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_setskinan keshkeh
 
2 BytesC++ course_2014_c13_ templates
2 BytesC++ course_2014_c13_ templates2 BytesC++ course_2014_c13_ templates
2 BytesC++ course_2014_c13_ templateskinan keshkeh
 
2 BytesC++ course_2014_c12_ polymorphism
2 BytesC++ course_2014_c12_ polymorphism2 BytesC++ course_2014_c12_ polymorphism
2 BytesC++ course_2014_c12_ polymorphismkinan keshkeh
 
2 BytesC++ course_2014_c11_ inheritance
2 BytesC++ course_2014_c11_ inheritance2 BytesC++ course_2014_c11_ inheritance
2 BytesC++ course_2014_c11_ inheritancekinan keshkeh
 
2 BytesC++ course_2014_c10_ separate compilation and namespaces
2 BytesC++ course_2014_c10_ separate compilation and namespaces 2 BytesC++ course_2014_c10_ separate compilation and namespaces
2 BytesC++ course_2014_c10_ separate compilation and namespaces kinan keshkeh
 
2 BytesC++ course_2014_c9_ pointers and dynamic arrays
2 BytesC++ course_2014_c9_ pointers and dynamic arrays 2 BytesC++ course_2014_c9_ pointers and dynamic arrays
2 BytesC++ course_2014_c9_ pointers and dynamic arrays kinan keshkeh
 

More from kinan keshkeh (20)

10 Little Tricks to Get Your Class’s Attention (and Hold It)
10 Little Tricks to Get Your  Class’s Attention (and Hold It)10 Little Tricks to Get Your  Class’s Attention (and Hold It)
10 Little Tricks to Get Your Class’s Attention (and Hold It)
 
Simpson and lagranje dalambair math methods
Simpson and lagranje dalambair math methods Simpson and lagranje dalambair math methods
Simpson and lagranje dalambair math methods
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop concept
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop concept
 
GeneticAlgorithms_AND_CuttingWoodAlgorithm
GeneticAlgorithms_AND_CuttingWoodAlgorithm  GeneticAlgorithms_AND_CuttingWoodAlgorithm
GeneticAlgorithms_AND_CuttingWoodAlgorithm
 
Algorithm in discovering and correcting words errors in a dictionary or any w...
Algorithm in discovering and correcting words errors in a dictionary or any w...Algorithm in discovering and correcting words errors in a dictionary or any w...
Algorithm in discovering and correcting words errors in a dictionary or any w...
 
2Bytesprog2 course_2014_c9_graph
2Bytesprog2 course_2014_c9_graph2Bytesprog2 course_2014_c9_graph
2Bytesprog2 course_2014_c9_graph
 
2Bytesprog2 course_2014_c8_units
2Bytesprog2 course_2014_c8_units2Bytesprog2 course_2014_c8_units
2Bytesprog2 course_2014_c8_units
 
2Bytesprog2 course_2014_c4_binaryfiles
2Bytesprog2 course_2014_c4_binaryfiles2Bytesprog2 course_2014_c4_binaryfiles
2Bytesprog2 course_2014_c4_binaryfiles
 
2Bytesprog2 course_2014_c3_txtfiles
2Bytesprog2 course_2014_c3_txtfiles2Bytesprog2 course_2014_c3_txtfiles
2Bytesprog2 course_2014_c3_txtfiles
 
2Bytesprog2 course_2014_c2_records
2Bytesprog2 course_2014_c2_records2Bytesprog2 course_2014_c2_records
2Bytesprog2 course_2014_c2_records
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets
 
2 BytesC++ course_2014_c13_ templates
2 BytesC++ course_2014_c13_ templates2 BytesC++ course_2014_c13_ templates
2 BytesC++ course_2014_c13_ templates
 
2 BytesC++ course_2014_c12_ polymorphism
2 BytesC++ course_2014_c12_ polymorphism2 BytesC++ course_2014_c12_ polymorphism
2 BytesC++ course_2014_c12_ polymorphism
 
2 BytesC++ course_2014_c11_ inheritance
2 BytesC++ course_2014_c11_ inheritance2 BytesC++ course_2014_c11_ inheritance
2 BytesC++ course_2014_c11_ inheritance
 
2 BytesC++ course_2014_c10_ separate compilation and namespaces
2 BytesC++ course_2014_c10_ separate compilation and namespaces 2 BytesC++ course_2014_c10_ separate compilation and namespaces
2 BytesC++ course_2014_c10_ separate compilation and namespaces
 
2 BytesC++ course_2014_c9_ pointers and dynamic arrays
2 BytesC++ course_2014_c9_ pointers and dynamic arrays 2 BytesC++ course_2014_c9_ pointers and dynamic arrays
2 BytesC++ course_2014_c9_ pointers and dynamic arrays
 

Recently uploaded

办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 

Recently uploaded (20)

Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 

2Bytesprog2 course_2014_c7_double_lists

  • 1. Prog_2 course- 2014 2 bytes team Kinan keshkeh IT Engineering-Damascus University 3rd year
  • 2. Double Lists Data next prev L_S Data next prev Data prev prev next next Data L_E
  • 3. Definition Type D_P = ^D_R; D_R = Record ID:integer; next:D_P; prev:D_P; end; var L_S, L_E : D_P;
  • 4. Double Lists Procedures: 1) Insert a Node 2) Delete a Node 3) Search Node
  • 5. Insert a Node Data next prev Data next prev Data next prev Data next prev L_E Data next prev L_S Temp
  • 6. 1) L_S Nil 15 next prev Temp L_E
  • 7. 3 next prev 20 next prev 15 next prev 2) L_S S L_E Temp
  • 8. 3 next prev 20 next prev 15 next prev 3) L_S S L_E 2 next prev Temp
  • 9. 3 next prev 20 next prev 15 next prev L_S S L_E 2 next prev Nil 4) Temp
  • 10. procedure D_L_Insert ( var L_S, L_E: D_P; KEY:integer); var Temp , S : D_P; Located: Boolean; begin new(Temp); temp^.ID:=KEY; temp^.next:=nil; temp^.prev:=nil; 15 next prev Temp
  • 11. If L_S=nil then begin L_S:=Temp; L_E:=Temp; end Else begin S:=L_S; Located:=False; while (S<>nil) and (not Located) do if S^.id < key then S:=S^.next else Located:=True; Temp^.next:=S; +2 points
  • 12. If S=L_S then begin L_S^.prev:=Temp; L_S:=Temp; end Else if S=nil then begin Temp^.prev := L_E; L_E^.next := Temp; L_E:=Temp; end Else begin Temp^.prev := S^.prev; S^.prev^.next := Temp; S^.prev := Temp; end; end; end; {procedure}
  • 13. 1) L_S Nil Delete a Node flag 3 L_E
  • 14. 3 next prev 20 next prev 15 next prev L_S L_E key 3 2) temp 3 next prev L_S Nil temp L_E flag 2
  • 15. 3 next prev 20 next prev 15 next prev L_S L_E temp 3) falg 2 key 20
  • 16. 3 next prev 20 next prev 15 next prev L_S L_E 4) flag 2 key 15 S
  • 17. 3 next prev 20 next prev 15 next prev L_S L_E Nil flag 1 key 99 5) S
  • 18. procedure D_L_Delete ( var L_S,L_E: D_P; KEY:integer; var flag :char); var Temp , S:D_P; begin If L_S=nil then flag:=‘3’ Else if KEY =L_S^.id then begin Temp:=L_S; L_S:=L_S^.next; ls^.prev:=nill ; Dispose(Temp); flag:=‘2’; If L_s=nil then L_E:=nil; Else L_s^.prev:=nil; end
  • 19. Else if KEY = L_E^.id then begin Temp:=L_E; L_E:=L_E^.prev; L_E^.next:=nil; Dispose(Temp); Flag:=‘2’; end Else begin S:=L_S; while (S<>nil) and (S^.id <> KEY ) do S:=S^.next; if S=nil then flag:=‘1’; else begin S^.next^.prev:=S^.prev; S^.prev^.next:=S^.next; Dispose(S); flag:=‘ 2 ’; end; end; end; {procedure}
  • 20. Homework: +15 points اكتب اجرائية البحث عه عنصر ما في سلسة مترابطة مه طرفيه : Search( var L_s, L_E : D_P ; Key:integer; var p: D_P ; var flag: char); بحيث تحفظ الاجرائية مؤشر على مكان العنصر المراد, وتعيد محرف يعبر عه حالة البحث ) فشل-وجد العنصر- السلسلة فارغة(
  • 21. Group : group link Mobile phone- Kinan : 0994385748 Facebook account : kinan’s account 2 bytes team