SlideShare une entreprise Scribd logo
1  sur  10
CONTENTS
• Introduction
• Relation of algorithm with Data Structures
• Multiplication of numbers
• Multiplication Problem with Iterative and
Recusrive Algorithm
• Karatsuba Integer Multiplication
INTRODUCTION TO DATA STRUCTURE
• Introduction
• Types of Data Structure
1. Primitive data structure
2. Non-primitive data structure
3. Static Data structure
4. Dynamic Data Structure
• Need for Data Structure
INTRODUCTION TO ALGORITHMS
• Introduction
• Types of Algorithms
1. Recursive Algorithm:
2. Randomized Algorithm:
3. Sorting Algorithm:
4. Searching Algorithm:
• Advantages of Algorithms:
• Disadvantages of Algorithms:
• Properties of algorithms:
RELATION OF ALGORITHM WITH DATA
STRUCTURES
Algorithm to find multiplication of numbers
• Start
Step 1: Int i;
Step 2: Int j ;
Step 3: Mul = i*j;
Step 4: print mul
Explanation:
• First we initialize the i variable .
• Initialize j variable.
• Declare variable mul which multiply i and j
Multiplication problem with iterative Method
Start
Step 1: int n;
Step 2: int factorial;
Step 3: for(int i ; i<=n ; i++)
factorial* = i;
Step 4: print factorial
Recursive Algorithm
Recursion is a method of solving a computational problem
where the solution depends on solutions to smaller instances
of the same problem. Recursion solves such recursive
problems by using functions that call themselves from within
their own code.
Recursive Algorithm
1. Read n
2. result = fact(n)
3. int fact (int n) { //function
if (n==0 || n==1)
return 1;
} else {
return n*fact(n-1);
}
}
4. print result;
Factorial program using recursive method
• import java.util.Scanner;
• public class FactorialCalculator3 {
• public static void main(String[] args) {
• Scanner scanner = new Scanner(System.in);
• System.out.print("Enter a number (n): ");
• int n = scanner.nextInt();
• int result = fact(n);
• System.out.println("The factorial of " + n + " is: " + result);
• scanner.close();
• }
• public static int fact(int n) {
• if (n == 0 || n == 1) {
• return 1; // Base case: factorial of 0 and 1 is 1
• } else {
• return n * fact(n - 1);
• }
• }
• }
Karatsuba algorithm
• The Karatsuba algorithm is a fast multiplication algorithm that
was introduced by Anatolii Alexeevitch Karatsuba in 1960. Its
primary advantage is that it reduces the number of recursive
multiplications involved in the process, making it more efficient
than traditional multiplication algorithms, especially for large
numbers.

Contenu connexe

Similaire à Data structure and algorithm presentation.pptx

Machine learning Experiments report
Machine learning Experiments report Machine learning Experiments report
Machine learning Experiments report AlmkdadAli
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithmsJulie Iskander
 
ch03-parameters-objects.ppt
ch03-parameters-objects.pptch03-parameters-objects.ppt
ch03-parameters-objects.pptMahyuddin8
 
VCE Unit 01 (1).pptx
VCE Unit 01 (1).pptxVCE Unit 01 (1).pptx
VCE Unit 01 (1).pptxskilljiolms
 
Programming in java basics
Programming in java  basicsProgramming in java  basics
Programming in java basicsLovelitJose
 
DS LAB RECORD.docx
DS LAB RECORD.docxDS LAB RECORD.docx
DS LAB RECORD.docxdavinci54
 
Lecture 2 role of algorithms in computing
Lecture 2   role of algorithms in computingLecture 2   role of algorithms in computing
Lecture 2 role of algorithms in computingjayavignesh86
 
New Functional Features of Java 8
New Functional Features of Java 8New Functional Features of Java 8
New Functional Features of Java 8franciscoortin
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)jehan1987
 
object oriented programming java lectures
object oriented programming java lecturesobject oriented programming java lectures
object oriented programming java lecturesMSohaib24
 
Create a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfCreate a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfrajeshjangid1865
 
Deep learning from scratch
Deep learning from scratch Deep learning from scratch
Deep learning from scratch Eran Shlomo
 
Python PCEP Comparison Operators And Conditional Execution
Python PCEP Comparison Operators And Conditional ExecutionPython PCEP Comparison Operators And Conditional Execution
Python PCEP Comparison Operators And Conditional ExecutionIHTMINSTITUTE
 
Unit II_Searching and Sorting Algorithms.ppt
Unit II_Searching and Sorting Algorithms.pptUnit II_Searching and Sorting Algorithms.ppt
Unit II_Searching and Sorting Algorithms.pptHODElex
 

Similaire à Data structure and algorithm presentation.pptx (20)

Machine learning Experiments report
Machine learning Experiments report Machine learning Experiments report
Machine learning Experiments report
 
Parameters
ParametersParameters
Parameters
 
02basics
02basics02basics
02basics
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
Algorithms with-java-1.0
Algorithms with-java-1.0Algorithms with-java-1.0
Algorithms with-java-1.0
 
Complexity
ComplexityComplexity
Complexity
 
ch03-parameters-objects.ppt
ch03-parameters-objects.pptch03-parameters-objects.ppt
ch03-parameters-objects.ppt
 
VCE Unit 01 (1).pptx
VCE Unit 01 (1).pptxVCE Unit 01 (1).pptx
VCE Unit 01 (1).pptx
 
Programming in java basics
Programming in java  basicsProgramming in java  basics
Programming in java basics
 
DS LAB RECORD.docx
DS LAB RECORD.docxDS LAB RECORD.docx
DS LAB RECORD.docx
 
Lecture 2 role of algorithms in computing
Lecture 2   role of algorithms in computingLecture 2   role of algorithms in computing
Lecture 2 role of algorithms in computing
 
New Functional Features of Java 8
New Functional Features of Java 8New Functional Features of Java 8
New Functional Features of Java 8
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)
 
Introduction to C ++.pptx
Introduction to C ++.pptxIntroduction to C ++.pptx
Introduction to C ++.pptx
 
Unit 2 algorithm
Unit   2 algorithmUnit   2 algorithm
Unit 2 algorithm
 
object oriented programming java lectures
object oriented programming java lecturesobject oriented programming java lectures
object oriented programming java lectures
 
Create a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdfCreate a menu-driven program that will accept a collection of non-ne.pdf
Create a menu-driven program that will accept a collection of non-ne.pdf
 
Deep learning from scratch
Deep learning from scratch Deep learning from scratch
Deep learning from scratch
 
Python PCEP Comparison Operators And Conditional Execution
Python PCEP Comparison Operators And Conditional ExecutionPython PCEP Comparison Operators And Conditional Execution
Python PCEP Comparison Operators And Conditional Execution
 
Unit II_Searching and Sorting Algorithms.ppt
Unit II_Searching and Sorting Algorithms.pptUnit II_Searching and Sorting Algorithms.ppt
Unit II_Searching and Sorting Algorithms.ppt
 

Dernier

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Dernier (20)

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Data structure and algorithm presentation.pptx

  • 1. CONTENTS • Introduction • Relation of algorithm with Data Structures • Multiplication of numbers • Multiplication Problem with Iterative and Recusrive Algorithm • Karatsuba Integer Multiplication
  • 2. INTRODUCTION TO DATA STRUCTURE • Introduction • Types of Data Structure 1. Primitive data structure 2. Non-primitive data structure 3. Static Data structure 4. Dynamic Data Structure • Need for Data Structure
  • 3. INTRODUCTION TO ALGORITHMS • Introduction • Types of Algorithms 1. Recursive Algorithm: 2. Randomized Algorithm: 3. Sorting Algorithm: 4. Searching Algorithm: • Advantages of Algorithms: • Disadvantages of Algorithms: • Properties of algorithms:
  • 4. RELATION OF ALGORITHM WITH DATA STRUCTURES
  • 5. Algorithm to find multiplication of numbers • Start Step 1: Int i; Step 2: Int j ; Step 3: Mul = i*j; Step 4: print mul Explanation: • First we initialize the i variable . • Initialize j variable. • Declare variable mul which multiply i and j
  • 6. Multiplication problem with iterative Method Start Step 1: int n; Step 2: int factorial; Step 3: for(int i ; i<=n ; i++) factorial* = i; Step 4: print factorial
  • 7. Recursive Algorithm Recursion is a method of solving a computational problem where the solution depends on solutions to smaller instances of the same problem. Recursion solves such recursive problems by using functions that call themselves from within their own code.
  • 8. Recursive Algorithm 1. Read n 2. result = fact(n) 3. int fact (int n) { //function if (n==0 || n==1) return 1; } else { return n*fact(n-1); } } 4. print result;
  • 9. Factorial program using recursive method • import java.util.Scanner; • public class FactorialCalculator3 { • public static void main(String[] args) { • Scanner scanner = new Scanner(System.in); • System.out.print("Enter a number (n): "); • int n = scanner.nextInt(); • int result = fact(n); • System.out.println("The factorial of " + n + " is: " + result); • scanner.close(); • } • public static int fact(int n) { • if (n == 0 || n == 1) { • return 1; // Base case: factorial of 0 and 1 is 1 • } else { • return n * fact(n - 1); • } • } • }
  • 10. Karatsuba algorithm • The Karatsuba algorithm is a fast multiplication algorithm that was introduced by Anatolii Alexeevitch Karatsuba in 1960. Its primary advantage is that it reduces the number of recursive multiplications involved in the process, making it more efficient than traditional multiplication algorithms, especially for large numbers.