SlideShare a Scribd company logo
1 of 2
Download to read offline
#include <initializer_list>
#include <iostream>
#include <iterator>
#include <utility>
/************************************************************/
template<typename T>
struct ListNode
{
ListNode () : data ()
{
}
ListNode (const T& v) : data (v)
{
}
ListNode (const T& v, ListNode* n, ListNode* p) : data (v), next (n), prev (p)
{
}
// unhooks the range [begin,end] from a linked list
// NOTE: will lose reference to begin and end if you
// are not keeping track of it!
//
// - does not create any new nodes
// - does not destroy any existing nodes
// - begin is start of range to remove
// - end is inclusive end of range to remove
//
// [5]
static void
unhook_range (ListNode* begin, ListNode* end)
{
// TODO
}
// inserts the range [first,last] before this
// NOTE: does not create any new nodes, does not destroy any existing nodes
//
// [5]
void
hook_range (ListNode* first, ListNode* last)
{
// TODO
}
// insert first before this
void
hook (ListNode* first)
{
hook_range (first, first);
}
// unhooks current node from linked list
void
unhook ()
{
ListNode::unhook_range (this, this);
}
T data;
ListNode* next{nullptr};
ListNode* prev{nullptr};
};
Please complete the implementation of the missing part marked TODO.

More Related Content

Similar to include ltinitializer_listgt include ltiostreamgt .pdf

There are a number of errors in the following program- All errors are.docx
There are a number of errors in the following program- All errors are.docxThere are a number of errors in the following program- All errors are.docx
There are a number of errors in the following program- All errors are.docx
clarkjanyce
 
Week 2 - Advanced C++list1.txt312220131197.docx
Week 2 - Advanced C++list1.txt312220131197.docxWeek 2 - Advanced C++list1.txt312220131197.docx
Week 2 - Advanced C++list1.txt312220131197.docx
melbruce90096
 
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
odiliagilby
 
maincpp Build and procees a sorted linked list of Patie.pdf
maincpp   Build and procees a sorted linked list of Patie.pdfmaincpp   Build and procees a sorted linked list of Patie.pdf
maincpp Build and procees a sorted linked list of Patie.pdf
adityastores21
 
This assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfThis assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdf
EricvtJFraserr
 
StackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdfStackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdf
ARCHANASTOREKOTA
 
AvlTree.h#ifndef AVL_TREE_H#define AVL_TREE_H#include d.docx
AvlTree.h#ifndef AVL_TREE_H#define AVL_TREE_H#include d.docxAvlTree.h#ifndef AVL_TREE_H#define AVL_TREE_H#include d.docx
AvlTree.h#ifndef AVL_TREE_H#define AVL_TREE_H#include d.docx
rock73
 
Fix my codeCode.pdf
Fix my codeCode.pdfFix my codeCode.pdf
Fix my codeCode.pdf
Conint29
 
How do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdfHow do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdf
feelinggift
 
please read below it will tell you what we are using L.pdf
please read below it will tell you what we are using   L.pdfplease read below it will tell you what we are using   L.pdf
please read below it will tell you what we are using L.pdf
ankit11134
 
1#include stdio.h#include stdlib.h#include assert.h .pdf
1#include stdio.h#include stdlib.h#include assert.h .pdf1#include stdio.h#include stdlib.h#include assert.h .pdf
1#include stdio.h#include stdlib.h#include assert.h .pdf
sudhinjv
 
Using C++I keep getting messagehead does not name a type.pdf
Using C++I keep getting messagehead does not name a type.pdfUsing C++I keep getting messagehead does not name a type.pdf
Using C++I keep getting messagehead does not name a type.pdf
alokkesh1
 
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfAssignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
formicreation
 
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdfC++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
callawaycorb73779
 
linked List.docx vhjgvjhvgjhjhbbjkhkjhkjh
linked List.docx vhjgvjhvgjhjhbbjkhkjhkjhlinked List.docx vhjgvjhvgjhjhbbjkhkjhkjh
linked List.docx vhjgvjhvgjhjhbbjkhkjhkjh
vasavim9
 
please read the steps below and it will tell you what we usi.pdf
please read the steps below and it will tell you what we usi.pdfplease read the steps below and it will tell you what we usi.pdf
please read the steps below and it will tell you what we usi.pdf
aggarwalopticalsco
 
we using java code DynamicArrayjava Replace all .pdf
we using java code   DynamicArrayjava   Replace all .pdfwe using java code   DynamicArrayjava   Replace all .pdf
we using java code DynamicArrayjava Replace all .pdf
gudduraza28
 
1- The design of a singly-linked list below is a picture of the functi (1).pdf
1- The design of a singly-linked list below is a picture of the functi (1).pdf1- The design of a singly-linked list below is a picture of the functi (1).pdf
1- The design of a singly-linked list below is a picture of the functi (1).pdf
afgt2012
 

Similar to include ltinitializer_listgt include ltiostreamgt .pdf (20)

There are a number of errors in the following program- All errors are.docx
There are a number of errors in the following program- All errors are.docxThere are a number of errors in the following program- All errors are.docx
There are a number of errors in the following program- All errors are.docx
 
Week 2 - Advanced C++list1.txt312220131197.docx
Week 2 - Advanced C++list1.txt312220131197.docxWeek 2 - Advanced C++list1.txt312220131197.docx
Week 2 - Advanced C++list1.txt312220131197.docx
 
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
 
maincpp Build and procees a sorted linked list of Patie.pdf
maincpp   Build and procees a sorted linked list of Patie.pdfmaincpp   Build and procees a sorted linked list of Patie.pdf
maincpp Build and procees a sorted linked list of Patie.pdf
 
This assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfThis assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdf
 
StackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdfStackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdf
 
AvlTree.h#ifndef AVL_TREE_H#define AVL_TREE_H#include d.docx
AvlTree.h#ifndef AVL_TREE_H#define AVL_TREE_H#include d.docxAvlTree.h#ifndef AVL_TREE_H#define AVL_TREE_H#include d.docx
AvlTree.h#ifndef AVL_TREE_H#define AVL_TREE_H#include d.docx
 
Fix my codeCode.pdf
Fix my codeCode.pdfFix my codeCode.pdf
Fix my codeCode.pdf
 
How do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdfHow do you stop infinite loop Because I believe that it is making a.pdf
How do you stop infinite loop Because I believe that it is making a.pdf
 
please read below it will tell you what we are using L.pdf
please read below it will tell you what we are using   L.pdfplease read below it will tell you what we are using   L.pdf
please read below it will tell you what we are using L.pdf
 
1#include stdio.h#include stdlib.h#include assert.h .pdf
1#include stdio.h#include stdlib.h#include assert.h .pdf1#include stdio.h#include stdlib.h#include assert.h .pdf
1#include stdio.h#include stdlib.h#include assert.h .pdf
 
Using C++I keep getting messagehead does not name a type.pdf
Using C++I keep getting messagehead does not name a type.pdfUsing C++I keep getting messagehead does not name a type.pdf
Using C++I keep getting messagehead does not name a type.pdf
 
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfAssignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
 
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdfC++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
 
linked List.docx vhjgvjhvgjhjhbbjkhkjhkjh
linked List.docx vhjgvjhvgjhjhbbjkhkjhkjhlinked List.docx vhjgvjhvgjhjhbbjkhkjhkjh
linked List.docx vhjgvjhvgjhjhbbjkhkjhkjh
 
please read the steps below and it will tell you what we usi.pdf
please read the steps below and it will tell you what we usi.pdfplease read the steps below and it will tell you what we usi.pdf
please read the steps below and it will tell you what we usi.pdf
 
C program to insert a node in doubly linked list
C program to insert a node in doubly linked listC program to insert a node in doubly linked list
C program to insert a node in doubly linked list
 
we using java code DynamicArrayjava Replace all .pdf
we using java code   DynamicArrayjava   Replace all .pdfwe using java code   DynamicArrayjava   Replace all .pdf
we using java code DynamicArrayjava Replace all .pdf
 
1- The design of a singly-linked list below is a picture of the functi (1).pdf
1- The design of a singly-linked list below is a picture of the functi (1).pdf1- The design of a singly-linked list below is a picture of the functi (1).pdf
1- The design of a singly-linked list below is a picture of the functi (1).pdf
 
C++11
C++11C++11
C++11
 

More from abidtelecom

More from abidtelecom (20)

Think of an organization with which you have been affiliated.pdf
Think of an organization with which you have been affiliated.pdfThink of an organization with which you have been affiliated.pdf
Think of an organization with which you have been affiliated.pdf
 
Modify your last GeoPoint program and add exception handling.pdf
Modify your last GeoPoint program and add exception handling.pdfModify your last GeoPoint program and add exception handling.pdf
Modify your last GeoPoint program and add exception handling.pdf
 
Which of the following is true regarding equity mutual funds.pdf
Which of the following is true regarding equity mutual funds.pdfWhich of the following is true regarding equity mutual funds.pdf
Which of the following is true regarding equity mutual funds.pdf
 
Wealth of Nationsda Adam Smith bir ulusun gerek zenginlii.pdf
Wealth of Nationsda Adam Smith bir ulusun gerek zenginlii.pdfWealth of Nationsda Adam Smith bir ulusun gerek zenginlii.pdf
Wealth of Nationsda Adam Smith bir ulusun gerek zenginlii.pdf
 
the students in the 17 member advanced communications desig.pdf
the students in the 17 member advanced communications desig.pdfthe students in the 17 member advanced communications desig.pdf
the students in the 17 member advanced communications desig.pdf
 
The Weibull distribution has probability density function f.pdf
The Weibull distribution has probability density function f.pdfThe Weibull distribution has probability density function f.pdf
The Weibull distribution has probability density function f.pdf
 
The DNA molgcule has two sides that are joined in the middle.pdf
The DNA molgcule has two sides that are joined in the middle.pdfThe DNA molgcule has two sides that are joined in the middle.pdf
The DNA molgcule has two sides that are joined in the middle.pdf
 
Table 2 DifferenceinDifferences Estimation Results with 12.pdf
Table 2 DifferenceinDifferences Estimation Results with 12.pdfTable 2 DifferenceinDifferences Estimation Results with 12.pdf
Table 2 DifferenceinDifferences Estimation Results with 12.pdf
 
Gastos generales de fabricacin Opcin multiple incluye m.pdf
Gastos generales de fabricacin  Opcin multiple  incluye m.pdfGastos generales de fabricacin  Opcin multiple  incluye m.pdf
Gastos generales de fabricacin Opcin multiple incluye m.pdf
 
Jafina trabaja para Sunshine Manufacturing donde su equipo .pdf
Jafina trabaja para Sunshine Manufacturing donde su equipo .pdfJafina trabaja para Sunshine Manufacturing donde su equipo .pdf
Jafina trabaja para Sunshine Manufacturing donde su equipo .pdf
 
Regarding genes and gene expression which of the following .pdf
Regarding genes and gene expression which of the following .pdfRegarding genes and gene expression which of the following .pdf
Regarding genes and gene expression which of the following .pdf
 
Python Programming 3 Create a dictionary containing three m.pdf
Python Programming 3 Create a dictionary containing three m.pdfPython Programming 3 Create a dictionary containing three m.pdf
Python Programming 3 Create a dictionary containing three m.pdf
 
please provide detailed step by step solutions thank you 8.pdf
please provide detailed step by step solutions thank you 8.pdfplease provide detailed step by step solutions thank you 8.pdf
please provide detailed step by step solutions thank you 8.pdf
 
Part 5 Financial Issues Low Potential 1 Moderate Potenti.pdf
Part 5 Financial Issues Low Potential 1 Moderate Potenti.pdfPart 5 Financial Issues Low Potential 1 Moderate Potenti.pdf
Part 5 Financial Issues Low Potential 1 Moderate Potenti.pdf
 
One of the options is Delta Airlines They have paid an annu.pdf
One of the options is Delta Airlines They have paid an annu.pdfOne of the options is Delta Airlines They have paid an annu.pdf
One of the options is Delta Airlines They have paid an annu.pdf
 
no AI generated answer or downvote Exercise 24 551 Le.pdf
no AI generated answer or downvote Exercise 24 551 Le.pdfno AI generated answer or downvote Exercise 24 551 Le.pdf
no AI generated answer or downvote Exercise 24 551 Le.pdf
 
En 2013 Bill Gates tena un valor aproximado de 28 mil mi.pdf
En 2013 Bill Gates tena un valor aproximado de  28 mil mi.pdfEn 2013 Bill Gates tena un valor aproximado de  28 mil mi.pdf
En 2013 Bill Gates tena un valor aproximado de 28 mil mi.pdf
 
Los estados financieros de propsito general incluyen 1 es.pdf
Los estados financieros de propsito general incluyen 1 es.pdfLos estados financieros de propsito general incluyen 1 es.pdf
Los estados financieros de propsito general incluyen 1 es.pdf
 
Level 3 Create or find a song online and use arrays to stor.pdf
Level 3 Create or find a song online and use arrays to stor.pdfLevel 3 Create or find a song online and use arrays to stor.pdf
Level 3 Create or find a song online and use arrays to stor.pdf
 
An HIVinfected client who is 6 weeks pregnant visits the he.pdf
An HIVinfected client who is 6 weeks pregnant visits the he.pdfAn HIVinfected client who is 6 weeks pregnant visits the he.pdf
An HIVinfected client who is 6 weeks pregnant visits the he.pdf
 

Recently uploaded

SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
Krashi Coaching
 

Recently uploaded (20)

Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
 

include ltinitializer_listgt include ltiostreamgt .pdf

  • 1. #include <initializer_list> #include <iostream> #include <iterator> #include <utility> /************************************************************/ template<typename T> struct ListNode { ListNode () : data () { } ListNode (const T& v) : data (v) { } ListNode (const T& v, ListNode* n, ListNode* p) : data (v), next (n), prev (p) { } // unhooks the range [begin,end] from a linked list // NOTE: will lose reference to begin and end if you // are not keeping track of it! // // - does not create any new nodes // - does not destroy any existing nodes // - begin is start of range to remove // - end is inclusive end of range to remove // // [5] static void unhook_range (ListNode* begin, ListNode* end) { // TODO } // inserts the range [first,last] before this // NOTE: does not create any new nodes, does not destroy any existing nodes // // [5] void hook_range (ListNode* first, ListNode* last) { // TODO } // insert first before this
  • 2. void hook (ListNode* first) { hook_range (first, first); } // unhooks current node from linked list void unhook () { ListNode::unhook_range (this, this); } T data; ListNode* next{nullptr}; ListNode* prev{nullptr}; }; Please complete the implementation of the missing part marked TODO.