SlideShare a Scribd company logo
Given an unsorted linked list, how to find the minimum element?
Solution
Solution : For finding the minimum element in an unsorted linked list various steps to be
followed -
Step 1 - Firstly from the unsorted linked list just remove all the duplicates.
Step 2 - Secondly we can choose any method from which we can do sorting which are using loop
or using simple sorting or using the hashing method.
In using loop method, two loops will be presented in which first loop picks up the elements and
second loop do comparison between the elements.
In using simple sorting method, first removal of duplicates then sort the linked list using merge
sort method.
In using hashing method, Firstly traversing of elements wiil be made from head to the end . If the
element is present in hash list then remove it other than this add the element to the list.
Step 3 - Finally we can get a minimum element from linked list.

More Related Content

Similar to Given an unsorted linked list- how to find the minimum element-Solutio (1).docx

unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.ppt
SeethaDinesh
 
searching
searchingsearching
searching
A. S. M. Shafi
 
programming in C
programming in Cprogramming in C
programming in C
ADITHYAM19
 
What is a linked listWhat is a linked lists general syntaxCan .pdf
What is a linked listWhat is a linked lists general syntaxCan .pdfWhat is a linked listWhat is a linked lists general syntaxCan .pdf
What is a linked listWhat is a linked lists general syntaxCan .pdf
bhim1213
 
Selection sort
Selection sortSelection sort
Selection sort
stella D
 
Searching and sorting
Searching  and sortingSearching  and sorting
Searching and sorting
PoojithaBollikonda
 
Searching_Sorting.pptx
Searching_Sorting.pptxSearching_Sorting.pptx
Searching_Sorting.pptx
21BD1A058RSahithi
 
Quick sort data structures
Quick sort data structuresQuick sort data structures
Quick sort data structures
chauhankapil
 
SORTING techniques.pptx
SORTING techniques.pptxSORTING techniques.pptx
SORTING techniques.pptx
Dr.Shweta
 
MODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingMODULE 5-Searching and-sorting
MODULE 5-Searching and-sorting
nikshaikh786
 
DS PPT - ( 1 )SORTING lgoritham techniques with bast example
DS PPT - ( 1 )SORTING lgoritham techniques with bast exampleDS PPT - ( 1 )SORTING lgoritham techniques with bast example
DS PPT - ( 1 )SORTING lgoritham techniques with bast example
Vivek487417
 
What is a Sorting Algorithm Ishank mini project.pptx
What is a Sorting Algorithm Ishank mini project.pptxWhat is a Sorting Algorithm Ishank mini project.pptx
What is a Sorting Algorithm Ishank mini project.pptx
SneakyGoblin1
 
Different types of Linked list.
Different types of Linked list.Different types of Linked list.
Different types of Linked list.
JAYANTAOJHA
 

Similar to Given an unsorted linked list- how to find the minimum element-Solutio (1).docx (13)

unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.ppt
 
searching
searchingsearching
searching
 
programming in C
programming in Cprogramming in C
programming in C
 
What is a linked listWhat is a linked lists general syntaxCan .pdf
What is a linked listWhat is a linked lists general syntaxCan .pdfWhat is a linked listWhat is a linked lists general syntaxCan .pdf
What is a linked listWhat is a linked lists general syntaxCan .pdf
 
Selection sort
Selection sortSelection sort
Selection sort
 
Searching and sorting
Searching  and sortingSearching  and sorting
Searching and sorting
 
Searching_Sorting.pptx
Searching_Sorting.pptxSearching_Sorting.pptx
Searching_Sorting.pptx
 
Quick sort data structures
Quick sort data structuresQuick sort data structures
Quick sort data structures
 
SORTING techniques.pptx
SORTING techniques.pptxSORTING techniques.pptx
SORTING techniques.pptx
 
MODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingMODULE 5-Searching and-sorting
MODULE 5-Searching and-sorting
 
DS PPT - ( 1 )SORTING lgoritham techniques with bast example
DS PPT - ( 1 )SORTING lgoritham techniques with bast exampleDS PPT - ( 1 )SORTING lgoritham techniques with bast example
DS PPT - ( 1 )SORTING lgoritham techniques with bast example
 
What is a Sorting Algorithm Ishank mini project.pptx
What is a Sorting Algorithm Ishank mini project.pptxWhat is a Sorting Algorithm Ishank mini project.pptx
What is a Sorting Algorithm Ishank mini project.pptx
 
Different types of Linked list.
Different types of Linked list.Different types of Linked list.
Different types of Linked list.
 

More from rtodd751

Given an unsorted linked list- how to find the minimum element-Solutio.docx
Given an unsorted linked list- how to find the minimum element-Solutio.docxGiven an unsorted linked list- how to find the minimum element-Solutio.docx
Given an unsorted linked list- how to find the minimum element-Solutio.docx
rtodd751
 
Given the following Binary Tree- show the box trace of Depth(N)-Soluti.docx
Given the following Binary Tree- show the box trace of Depth(N)-Soluti.docxGiven the following Binary Tree- show the box trace of Depth(N)-Soluti.docx
Given the following Binary Tree- show the box trace of Depth(N)-Soluti.docx
rtodd751
 
Given the following class declaration- write the code in Java for the.docx
Given the following class declaration- write the code in Java for the.docxGiven the following class declaration- write the code in Java for the.docx
Given the following class declaration- write the code in Java for the.docx
rtodd751
 
Given a list of numbers- count and return how many pairs there are- A.docx
Given a list of numbers- count and return how many pairs there are- A.docxGiven a list of numbers- count and return how many pairs there are- A.docx
Given a list of numbers- count and return how many pairs there are- A.docx
rtodd751
 
Given 5 moles of H2SO4 react with excess NaOH how many moles of water.docx
Given 5 moles of H2SO4 react with excess NaOH how many moles of water.docxGiven 5 moles of H2SO4 react with excess NaOH how many moles of water.docx
Given 5 moles of H2SO4 react with excess NaOH how many moles of water.docx
rtodd751
 
Give five latest and uncommon research topics in intelligent vehicular.docx
Give five latest and uncommon research topics in intelligent vehicular.docxGive five latest and uncommon research topics in intelligent vehicular.docx
Give five latest and uncommon research topics in intelligent vehicular.docx
rtodd751
 
Give and explain the periodic trend of atomic radius for the 3rd perio.docx
Give and explain the periodic trend of atomic radius for the 3rd perio.docxGive and explain the periodic trend of atomic radius for the 3rd perio.docx
Give and explain the periodic trend of atomic radius for the 3rd perio.docx
rtodd751
 
Give an example of a business objective and the related Key Performanc.docx
Give an example of a business objective and the related Key Performanc.docxGive an example of a business objective and the related Key Performanc.docx
Give an example of a business objective and the related Key Performanc.docx
rtodd751
 
General Motors exports cars to Spain- but the strong dollar against th.docx
General Motors exports cars to Spain- but the strong dollar against th.docxGeneral Motors exports cars to Spain- but the strong dollar against th.docx
General Motors exports cars to Spain- but the strong dollar against th.docx
rtodd751
 

More from rtodd751 (9)

Given an unsorted linked list- how to find the minimum element-Solutio.docx
Given an unsorted linked list- how to find the minimum element-Solutio.docxGiven an unsorted linked list- how to find the minimum element-Solutio.docx
Given an unsorted linked list- how to find the minimum element-Solutio.docx
 
Given the following Binary Tree- show the box trace of Depth(N)-Soluti.docx
Given the following Binary Tree- show the box trace of Depth(N)-Soluti.docxGiven the following Binary Tree- show the box trace of Depth(N)-Soluti.docx
Given the following Binary Tree- show the box trace of Depth(N)-Soluti.docx
 
Given the following class declaration- write the code in Java for the.docx
Given the following class declaration- write the code in Java for the.docxGiven the following class declaration- write the code in Java for the.docx
Given the following class declaration- write the code in Java for the.docx
 
Given a list of numbers- count and return how many pairs there are- A.docx
Given a list of numbers- count and return how many pairs there are- A.docxGiven a list of numbers- count and return how many pairs there are- A.docx
Given a list of numbers- count and return how many pairs there are- A.docx
 
Given 5 moles of H2SO4 react with excess NaOH how many moles of water.docx
Given 5 moles of H2SO4 react with excess NaOH how many moles of water.docxGiven 5 moles of H2SO4 react with excess NaOH how many moles of water.docx
Given 5 moles of H2SO4 react with excess NaOH how many moles of water.docx
 
Give five latest and uncommon research topics in intelligent vehicular.docx
Give five latest and uncommon research topics in intelligent vehicular.docxGive five latest and uncommon research topics in intelligent vehicular.docx
Give five latest and uncommon research topics in intelligent vehicular.docx
 
Give and explain the periodic trend of atomic radius for the 3rd perio.docx
Give and explain the periodic trend of atomic radius for the 3rd perio.docxGive and explain the periodic trend of atomic radius for the 3rd perio.docx
Give and explain the periodic trend of atomic radius for the 3rd perio.docx
 
Give an example of a business objective and the related Key Performanc.docx
Give an example of a business objective and the related Key Performanc.docxGive an example of a business objective and the related Key Performanc.docx
Give an example of a business objective and the related Key Performanc.docx
 
General Motors exports cars to Spain- but the strong dollar against th.docx
General Motors exports cars to Spain- but the strong dollar against th.docxGeneral Motors exports cars to Spain- but the strong dollar against th.docx
General Motors exports cars to Spain- but the strong dollar against th.docx
 

Recently uploaded

Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
ArianaBusciglio
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 

Recently uploaded (20)

Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 

Given an unsorted linked list- how to find the minimum element-Solutio (1).docx

  • 1. Given an unsorted linked list, how to find the minimum element? Solution Solution : For finding the minimum element in an unsorted linked list various steps to be followed - Step 1 - Firstly from the unsorted linked list just remove all the duplicates. Step 2 - Secondly we can choose any method from which we can do sorting which are using loop or using simple sorting or using the hashing method. In using loop method, two loops will be presented in which first loop picks up the elements and second loop do comparison between the elements. In using simple sorting method, first removal of duplicates then sort the linked list using merge sort method. In using hashing method, Firstly traversing of elements wiil be made from head to the end . If the element is present in hash list then remove it other than this add the element to the list. Step 3 - Finally we can get a minimum element from linked list.