•Download as PPTX, PDF•

0 likes•7 views

This document discusses algorithm design and efficiency. It provides guidelines for designing efficient algorithms that minimize resource usage and execution time. Searching and sorting algorithms are introduced as important techniques for efficiently searching arrays and sorting data. Common searching algorithms like sequential search and binary search are described. Sorting algorithms like selection sort, bubble sort, and insertion sort are also outlined. The document uses a supermarket metaphor to illustrate the importance of algorithm efficiency.

Report

Share

Report

Share

CPP12 - Algorithms

This is an introductory lecture on C++, suitable for first year computing students or those doing a conversion masters degree at postgraduate level.

daa unit 1.pptx

The document provides an introduction to algorithms and their analysis. It discusses the definition of an algorithm, their characteristics, types and examples. It also covers the analysis of algorithms including best, average and worst case analysis. Common asymptotic notations like Big-O, Omega and Theta notations are introduced to analyze the time complexity of algorithms. Examples of analyzing for loops and other control statements are provided.

Algorithm analysis (All in one)

Algorithm analysis (All in one): Algorithm, Algoritthm Analysis, data structure, algorithm, algorithm Complexity, Floyd Algorithm, Kruskel Algorithm, Pakistan, Sorting Complexity, Big O notations, Time Complexity, Computational Complexity, Bubble Sort Complexity, Best case, Worst Case, Inversion in Algorithm, Traveling Salesperson Problem.

Sorting And Type of Sorting

Sorting is any process of arranging items systematically, and has two common, yet distinct meanings: ordering: arranging items in a sequence ordered by some criterion; categorizing: grouping items with similar properties.Common sorting algorithms. Sorting algorithm
Bubble/Shell sort: Exchange two adjacent elements if they are out of order. Repeat until array is sorted.
Insertion sort: Scan successive elements for an out-of-order item, then insert the item in the proper place.
Selection sort: Find the smallest (or biggest) element in the array, and put it in the proper place. Swap it with the value in the first position. Repeat until array is sorted.
Quick sort: Partition the array into two segments. In the first segment, all elements are less than or equal to the pivot value. In the second segment, all elements are greater than or equal to the pivot value. Finally, sort the two segments recursively.
'Merge sort': Divide the list of elements in two parts, sort the two parts individually and then merge it.

Rahat & juhith

This document discusses linear search and binary search algorithms. Linear search sequentially checks each element of an unsorted array to find a target value, resulting in O(n) time complexity. Binary search works on a sorted array, comparing the target to the middle element and recursively searching half the array, requiring O(log n) time. The document provides pseudocode for both algorithms and compares their performance on different sized inputs. It also discusses properties of greedy algorithms and provides an example of when a greedy solution fails to find the optimal result.

Data Structures and Algorithm - Module 1.pptx

This document provides an introduction to data structures and algorithms from instructor Ellen Grace Porras. It defines data structures as ways of organizing data to allow for efficient operations. Linear data structures like arrays, stacks, and queues arrange elements sequentially, while non-linear structures like trees and graphs have hierarchical relationships. The document discusses characteristics of good data structures and algorithms, provides examples of common algorithms, and distinguishes between linear and non-linear data structures. It aims to explain the fundamentals of data structures and algorithms.

data_structure_Chapter two_computer.pptx

The document discusses various searching and sorting algorithms that use the divide and conquer approach. It describes linear search, binary search, and merge sort algorithms. Linear search has a time complexity of O(n) as it must examine each element to find the target. Binary search has a time complexity of O(log n) as it divides the search space in half each iteration. Merge sort also has a time complexity of O(n log n) as it divides the list into single elements and then merges them back together in sorted order.

SORTING techniques.pptx

Sorting in data structures is a fundamental operation that is crucial for optimizing the efficiency of data retrieval and manipulation. By ordering data elements according to a defined sequence (numerical, lexicographical, etc.), sorting makes it possible to search for elements more quickly than would be possible in an unsorted structure, especially with algorithms like binary search that rely on a sorted array to operate effectively.
In addition, sorting is essential for tasks that require an ordered dataset, such as finding median values, generating frequency counts, or performing range queries. It also lays the groundwork for more complex operations, such as merging datasets, which requires sorted data to be carried out efficiently.

CPP12 - Algorithms

This is an introductory lecture on C++, suitable for first year computing students or those doing a conversion masters degree at postgraduate level.

daa unit 1.pptx

The document provides an introduction to algorithms and their analysis. It discusses the definition of an algorithm, their characteristics, types and examples. It also covers the analysis of algorithms including best, average and worst case analysis. Common asymptotic notations like Big-O, Omega and Theta notations are introduced to analyze the time complexity of algorithms. Examples of analyzing for loops and other control statements are provided.

Algorithm analysis (All in one)

Algorithm analysis (All in one): Algorithm, Algoritthm Analysis, data structure, algorithm, algorithm Complexity, Floyd Algorithm, Kruskel Algorithm, Pakistan, Sorting Complexity, Big O notations, Time Complexity, Computational Complexity, Bubble Sort Complexity, Best case, Worst Case, Inversion in Algorithm, Traveling Salesperson Problem.

Sorting And Type of Sorting

Sorting is any process of arranging items systematically, and has two common, yet distinct meanings: ordering: arranging items in a sequence ordered by some criterion; categorizing: grouping items with similar properties.Common sorting algorithms. Sorting algorithm
Bubble/Shell sort: Exchange two adjacent elements if they are out of order. Repeat until array is sorted.
Insertion sort: Scan successive elements for an out-of-order item, then insert the item in the proper place.
Selection sort: Find the smallest (or biggest) element in the array, and put it in the proper place. Swap it with the value in the first position. Repeat until array is sorted.
Quick sort: Partition the array into two segments. In the first segment, all elements are less than or equal to the pivot value. In the second segment, all elements are greater than or equal to the pivot value. Finally, sort the two segments recursively.
'Merge sort': Divide the list of elements in two parts, sort the two parts individually and then merge it.

Rahat & juhith

This document discusses linear search and binary search algorithms. Linear search sequentially checks each element of an unsorted array to find a target value, resulting in O(n) time complexity. Binary search works on a sorted array, comparing the target to the middle element and recursively searching half the array, requiring O(log n) time. The document provides pseudocode for both algorithms and compares their performance on different sized inputs. It also discusses properties of greedy algorithms and provides an example of when a greedy solution fails to find the optimal result.

Data Structures and Algorithm - Module 1.pptx

This document provides an introduction to data structures and algorithms from instructor Ellen Grace Porras. It defines data structures as ways of organizing data to allow for efficient operations. Linear data structures like arrays, stacks, and queues arrange elements sequentially, while non-linear structures like trees and graphs have hierarchical relationships. The document discusses characteristics of good data structures and algorithms, provides examples of common algorithms, and distinguishes between linear and non-linear data structures. It aims to explain the fundamentals of data structures and algorithms.

data_structure_Chapter two_computer.pptx

The document discusses various searching and sorting algorithms that use the divide and conquer approach. It describes linear search, binary search, and merge sort algorithms. Linear search has a time complexity of O(n) as it must examine each element to find the target. Binary search has a time complexity of O(log n) as it divides the search space in half each iteration. Merge sort also has a time complexity of O(n log n) as it divides the list into single elements and then merges them back together in sorted order.

SORTING techniques.pptx

Sorting in data structures is a fundamental operation that is crucial for optimizing the efficiency of data retrieval and manipulation. By ordering data elements according to a defined sequence (numerical, lexicographical, etc.), sorting makes it possible to search for elements more quickly than would be possible in an unsorted structure, especially with algorithms like binary search that rely on a sorted array to operate effectively.
In addition, sorting is essential for tasks that require an ordered dataset, such as finding median values, generating frequency counts, or performing range queries. It also lays the groundwork for more complex operations, such as merging datasets, which requires sorted data to be carried out efficiently.

cs702 ppt.ppt

The document discusses various searching algorithms and their time complexities. It describes linear search, binary search, jump search, interpolation search, exponential search, sublist search, Fibonacci search. Linear search has a time complexity of O(n) while binary search has O(log n) time complexity. Binary search uses a divide and conquer approach to search sorted data more efficiently. Exponential and Fibonacci searches also have O(log n) time complexity for bounded arrays.

Excel tips

Here are 3 scenarios for the Airbus A3XX model using the Scenarios add-in:
Worst case:
- 200 planes sold
- $120 million price per plane
- 20% margin
- $13 billion R&D cost
Realistic case:
- 350 planes sold
- $130 million price per plane
- 25% margin
- $12 billion R&D cost
Best case:
- 500 planes sold
- $150 million price per plane
- 30% margin
- $11 billion R&D cost
The Scenarios add-in allows you to easily model different input scenarios and see the resulting profit outputs, which is useful for

Excel Tips 101

Here are 3 scenarios for the Airbus A3XX model using the Scenarios add-in:
Worst case:
- 200 planes sold
- $120 million price per plane
- 20% margin
- $13 billion R&D cost
Realistic case:
- 350 planes sold
- $130 million price per plane
- 25% margin
- $12 billion R&D cost
Best case:
- 500 planes sold
- $150 million price per plane
- 30% margin
- $11 billion R&D cost
By setting up the scenarios add-in, Airbus can easily model and compare the profitability of the A3XX under

Sorting

The document discusses sorting algorithms. It begins by defining sorting as arranging data in logical order based on a key. It then discusses internal and external sorting methods. For internal sorting, all data fits in memory, while external sorting handles data too large for memory. The document covers stability, efficiency, and time complexity of various sorting algorithms like bubble sort, selection sort, insertion sort, and merge sort. Merge sort uses a divide-and-conquer approach to sort arrays with a time complexity of O(n log n).

Data Structure & Algorithms - Operations

The document discusses various data structure operations like traversing, searching, inserting, updating, deleting, sorting, and merging. It then provides examples of how these operations would be used on a membership file containing member details. The document also introduces abstract data types, defining them as a type plus functions and behavior. It discusses abstract data type operations like create, display, insert, delete, and modify. Finally, it covers linear and binary search algorithms, providing pseudocode examples and comparing their advantages and disadvantages.

Excel Tips.pptx

Here are 3 scenarios for the A3XX model:
Scenario 1 (Base case):
Number of planes sold = 100
Price = $200 million
Margin = 10%
Development cost = $15 billion
Scenario 2 (Higher demand):
Number of planes sold = 150
Price = $200 million
Margin = 10%
Development cost = $15 billion
Scenario 3 (Lower cost):
Number of planes sold = 100
Price = $200 million
Margin = 10%
Development cost = $12 billion
20. SCENARIOS ADD-IN
Exercise

4.1 sequentioal search

The document discusses various algorithms for arrays in computer programming, including reviewing what arrays are, comparing arrays, calculating the sum, average, minimum and maximum of array elements, handling partially filled arrays, sequential search, selection sort, and binary search algorithms. It provides examples of code for many of these algorithms.

Linear search-and-binary-search

This document provides an overview of linear search and binary search algorithms.
It explains that linear search sequentially searches through an array one element at a time to find a target value. It is simple to implement but has poor efficiency as the time scales linearly with the size of the input.
Binary search is more efficient by cutting the search space in half at each step. It works on a sorted array by comparing the target to the middle element and determining which half to search next. The time complexity of binary search is logarithmic rather than linear.

Excel tips

This document provides an overview of a 3-4 hour training program on Excel tips and functions for associates and business analysts. It includes 31 Excel tips organized into sections that cover functions and tools to split windows, hide/unhide rows and columns, navigate sheets efficiently, name cells, sort data, use formulas like IF, SUM, COUNT, and VLOOKUP, and other topics. Exercises are provided throughout to help participants practice each skill. Senior managers previously found the material very useful for showing their own proficiency with Excel.

Algorithms

This document discusses algorithms and how computers use them. It begins with an introduction to algorithms, defining them as precise step-by-step instructions to complete a task. Examples of algorithms like making tea and sorting cards are provided. Two sorting algorithms are described: simple sort and selection sort. Tasks are included to have the student write algorithms and do card sorting. The document concludes by analyzing which sorting algorithm is most efficient based on comparisons and memory usage.

ADS Introduction

This document provides an overview of advanced data structures and algorithms. It defines data structures as a way to store and organize data for efficient access and modification. The document then reviews basic concepts like variables, data types, and algorithms. It describes common data structures like arrays, linked lists, stacks, queues, trees, and hash tables. It also covers topics like asymptotic analysis, algorithms analysis, and the substitution method for solving algorithm recurrences. The document is an introduction to advanced data structure and algorithm concepts.

BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI

1. The document discusses various searching and sorting algorithms. It describes linear search, which compares each element to find a match, and binary search, which eliminates half the elements after each comparison in a sorted array.
2. It also explains bubble sort, which bubbles larger values up and smaller values down through multiple passes. Radix sort sorts elements based on individual digits or characters.
3. Selection sort and merge sort are also summarized. Merge sort divides the array into single elements and then merges the sorted sublists, while selection sort finds the minimum element and swaps it into place in each pass.

Sorting

A sorting algorithm is an algorithm that puts elements of a list in a certain order. The most-used orders are numerical order and lexicographical order
What is sorting algorithm
The bubble sort
The selection sort
The insertion sort
The Quick sort
The Shell Sort

Algorithm.pptx

The document discusses algorithms and their properties. It defines an algorithm as a finite sequence of steps to solve a specific problem. Algorithms must have a defined input and output, and can solve the same problem in different ways. Common algorithm types include recursive, dynamic programming, backtracking, divide and conquer, greedy, brute force, and heuristic algorithms. Efficiency is measured by time and space complexity. Variables are introduced as a way to store input, intermediate results, and output values in algorithms.

Lecture 1 computing and algorithms

The document discusses computational thinking and algorithms. It defines computational thinking as a problem solving process involving analysis, modeling, understanding how computers work, logic, and procedure design. An algorithm is described as a detailed set of instructions to solve a problem, while a program is an implementation of an algorithm in a specific programming language. Common ways to express algorithms are through flowcharts, Nassi-Schneiderman diagrams, and pseudo-code. These allow visualizing an algorithm's sequential steps, branches, and loops.

Alogorithm ppr slideshow

This document provides information about algorithms including definitions, types of algorithms, and examples. It defines an algorithm as a set of instructions to solve a problem or accomplish a task. It lists common algorithm types such as searching, sorting, divide and conquer, greedy algorithms, and recursion. As examples, it describes linear search, selection sort, and provides pseudocode for a phone book program that uses sorting and searching algorithms. The program allows the user to input data, choose a sorting or searching algorithm, and displays the output.

Data structure and algorithms

The document discusses various searching, hashing, and sorting algorithms. It begins by defining searching as the process of locating target data and describes linear and binary search techniques. It then explains linear search, linear search algorithms, and the advantages and disadvantages of linear search. Next, it covers binary search, hashing, hashing functions, hash collisions, collision resolution techniques including separate chaining and open addressing. Finally, it discusses various sorting algorithms like bubble sort, selection sort, radix sort, heap sort, and merge sort which is used for external sorting.

Algorithms 1

The document discusses algorithms, including:
1. What algorithms are, their uses, and what they consist of.
2. Techniques for representing algorithms such as pseudocode, flowcharts, and code.
3. How to analyze algorithms to determine efficiency regarding time and resources.

IRJET- A Survey on Different Searching Algorithms

The document summarizes and compares several common search algorithms:
- Binary search has the best average time complexity of O(log n) but only works on sorted data. Linear search has average time complexity of O(n) and works on any data but is less efficient.
- Hybrid search combines linear and binary search to search unsorted arrays more efficiently than linear search. Interpolation search is an improvement on binary search that may search in different locations based on the search key value.
- Jump search works on sorted data by jumping in blocks of size sqrt(n) and doing a linear search within blocks. It has better average performance than linear search but only works on sorted data.

Introduction Computer Science - Software Design.pdf

Mr. K introduces himself as a teacher of IT, computer science, and math who has 20 years of experience in education. He has a master's degree in computer science and has worked as an IT/CS teacher, high school math teacher, and Microsoft Certified Trainer. He is happy to now be teaching at MKIS. The document goes on to prompt students to introduce themselves and ask what they want to learn in the class. It also addresses stereotypes about computer science, explaining that it involves designing complex systems to solve problems, while information technology focuses on using existing technology to meet daily job needs.

Working with files (concepts/pseudocode/python)

The document discusses working with files in software, including reading from and writing to files, different file formats, text files specifically, and provides pseudocode and Python code examples for opening, writing, reading, and closing files. It also covers end-of-line and end-of-file markers that are important for properly reading and writing text files.

cs702 ppt.ppt

The document discusses various searching algorithms and their time complexities. It describes linear search, binary search, jump search, interpolation search, exponential search, sublist search, Fibonacci search. Linear search has a time complexity of O(n) while binary search has O(log n) time complexity. Binary search uses a divide and conquer approach to search sorted data more efficiently. Exponential and Fibonacci searches also have O(log n) time complexity for bounded arrays.

Excel tips

Here are 3 scenarios for the Airbus A3XX model using the Scenarios add-in:
Worst case:
- 200 planes sold
- $120 million price per plane
- 20% margin
- $13 billion R&D cost
Realistic case:
- 350 planes sold
- $130 million price per plane
- 25% margin
- $12 billion R&D cost
Best case:
- 500 planes sold
- $150 million price per plane
- 30% margin
- $11 billion R&D cost
The Scenarios add-in allows you to easily model different input scenarios and see the resulting profit outputs, which is useful for

Excel Tips 101

Here are 3 scenarios for the Airbus A3XX model using the Scenarios add-in:
Worst case:
- 200 planes sold
- $120 million price per plane
- 20% margin
- $13 billion R&D cost
Realistic case:
- 350 planes sold
- $130 million price per plane
- 25% margin
- $12 billion R&D cost
Best case:
- 500 planes sold
- $150 million price per plane
- 30% margin
- $11 billion R&D cost
By setting up the scenarios add-in, Airbus can easily model and compare the profitability of the A3XX under

Sorting

The document discusses sorting algorithms. It begins by defining sorting as arranging data in logical order based on a key. It then discusses internal and external sorting methods. For internal sorting, all data fits in memory, while external sorting handles data too large for memory. The document covers stability, efficiency, and time complexity of various sorting algorithms like bubble sort, selection sort, insertion sort, and merge sort. Merge sort uses a divide-and-conquer approach to sort arrays with a time complexity of O(n log n).

Data Structure & Algorithms - Operations

The document discusses various data structure operations like traversing, searching, inserting, updating, deleting, sorting, and merging. It then provides examples of how these operations would be used on a membership file containing member details. The document also introduces abstract data types, defining them as a type plus functions and behavior. It discusses abstract data type operations like create, display, insert, delete, and modify. Finally, it covers linear and binary search algorithms, providing pseudocode examples and comparing their advantages and disadvantages.

Excel Tips.pptx

Here are 3 scenarios for the A3XX model:
Scenario 1 (Base case):
Number of planes sold = 100
Price = $200 million
Margin = 10%
Development cost = $15 billion
Scenario 2 (Higher demand):
Number of planes sold = 150
Price = $200 million
Margin = 10%
Development cost = $15 billion
Scenario 3 (Lower cost):
Number of planes sold = 100
Price = $200 million
Margin = 10%
Development cost = $12 billion
20. SCENARIOS ADD-IN
Exercise

4.1 sequentioal search

The document discusses various algorithms for arrays in computer programming, including reviewing what arrays are, comparing arrays, calculating the sum, average, minimum and maximum of array elements, handling partially filled arrays, sequential search, selection sort, and binary search algorithms. It provides examples of code for many of these algorithms.

Linear search-and-binary-search

This document provides an overview of linear search and binary search algorithms.
It explains that linear search sequentially searches through an array one element at a time to find a target value. It is simple to implement but has poor efficiency as the time scales linearly with the size of the input.
Binary search is more efficient by cutting the search space in half at each step. It works on a sorted array by comparing the target to the middle element and determining which half to search next. The time complexity of binary search is logarithmic rather than linear.

Excel tips

This document provides an overview of a 3-4 hour training program on Excel tips and functions for associates and business analysts. It includes 31 Excel tips organized into sections that cover functions and tools to split windows, hide/unhide rows and columns, navigate sheets efficiently, name cells, sort data, use formulas like IF, SUM, COUNT, and VLOOKUP, and other topics. Exercises are provided throughout to help participants practice each skill. Senior managers previously found the material very useful for showing their own proficiency with Excel.

Algorithms

This document discusses algorithms and how computers use them. It begins with an introduction to algorithms, defining them as precise step-by-step instructions to complete a task. Examples of algorithms like making tea and sorting cards are provided. Two sorting algorithms are described: simple sort and selection sort. Tasks are included to have the student write algorithms and do card sorting. The document concludes by analyzing which sorting algorithm is most efficient based on comparisons and memory usage.

ADS Introduction

This document provides an overview of advanced data structures and algorithms. It defines data structures as a way to store and organize data for efficient access and modification. The document then reviews basic concepts like variables, data types, and algorithms. It describes common data structures like arrays, linked lists, stacks, queues, trees, and hash tables. It also covers topics like asymptotic analysis, algorithms analysis, and the substitution method for solving algorithm recurrences. The document is an introduction to advanced data structure and algorithm concepts.

BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI

1. The document discusses various searching and sorting algorithms. It describes linear search, which compares each element to find a match, and binary search, which eliminates half the elements after each comparison in a sorted array.
2. It also explains bubble sort, which bubbles larger values up and smaller values down through multiple passes. Radix sort sorts elements based on individual digits or characters.
3. Selection sort and merge sort are also summarized. Merge sort divides the array into single elements and then merges the sorted sublists, while selection sort finds the minimum element and swaps it into place in each pass.

Sorting

A sorting algorithm is an algorithm that puts elements of a list in a certain order. The most-used orders are numerical order and lexicographical order
What is sorting algorithm
The bubble sort
The selection sort
The insertion sort
The Quick sort
The Shell Sort

Algorithm.pptx

The document discusses algorithms and their properties. It defines an algorithm as a finite sequence of steps to solve a specific problem. Algorithms must have a defined input and output, and can solve the same problem in different ways. Common algorithm types include recursive, dynamic programming, backtracking, divide and conquer, greedy, brute force, and heuristic algorithms. Efficiency is measured by time and space complexity. Variables are introduced as a way to store input, intermediate results, and output values in algorithms.

Lecture 1 computing and algorithms

The document discusses computational thinking and algorithms. It defines computational thinking as a problem solving process involving analysis, modeling, understanding how computers work, logic, and procedure design. An algorithm is described as a detailed set of instructions to solve a problem, while a program is an implementation of an algorithm in a specific programming language. Common ways to express algorithms are through flowcharts, Nassi-Schneiderman diagrams, and pseudo-code. These allow visualizing an algorithm's sequential steps, branches, and loops.

Alogorithm ppr slideshow

This document provides information about algorithms including definitions, types of algorithms, and examples. It defines an algorithm as a set of instructions to solve a problem or accomplish a task. It lists common algorithm types such as searching, sorting, divide and conquer, greedy algorithms, and recursion. As examples, it describes linear search, selection sort, and provides pseudocode for a phone book program that uses sorting and searching algorithms. The program allows the user to input data, choose a sorting or searching algorithm, and displays the output.

Data structure and algorithms

The document discusses various searching, hashing, and sorting algorithms. It begins by defining searching as the process of locating target data and describes linear and binary search techniques. It then explains linear search, linear search algorithms, and the advantages and disadvantages of linear search. Next, it covers binary search, hashing, hashing functions, hash collisions, collision resolution techniques including separate chaining and open addressing. Finally, it discusses various sorting algorithms like bubble sort, selection sort, radix sort, heap sort, and merge sort which is used for external sorting.

Algorithms 1

The document discusses algorithms, including:
1. What algorithms are, their uses, and what they consist of.
2. Techniques for representing algorithms such as pseudocode, flowcharts, and code.
3. How to analyze algorithms to determine efficiency regarding time and resources.

IRJET- A Survey on Different Searching Algorithms

The document summarizes and compares several common search algorithms:
- Binary search has the best average time complexity of O(log n) but only works on sorted data. Linear search has average time complexity of O(n) and works on any data but is less efficient.
- Hybrid search combines linear and binary search to search unsorted arrays more efficiently than linear search. Interpolation search is an improvement on binary search that may search in different locations based on the search key value.
- Jump search works on sorted data by jumping in blocks of size sqrt(n) and doing a linear search within blocks. It has better average performance than linear search but only works on sorted data.

cs702 ppt.ppt

cs702 ppt.ppt

Excel tips

Excel tips

Excel Tips 101

Excel Tips 101

Sorting

Sorting

Data Structure & Algorithms - Operations

Data Structure & Algorithms - Operations

Excel Tips.pptx

Excel Tips.pptx

4.1 sequentioal search

4.1 sequentioal search

Linear search-and-binary-search

Linear search-and-binary-search

Excel tips

Excel tips

Algorithms

Algorithms

DS PPT - ( 1 )SORTING lgoritham techniques with bast example

DS PPT - ( 1 )SORTING lgoritham techniques with bast example

ADS Introduction

ADS Introduction

BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI

BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI

Sorting

Sorting

Algorithm.pptx

Algorithm.pptx

Lecture 1 computing and algorithms

Lecture 1 computing and algorithms

Alogorithm ppr slideshow

Alogorithm ppr slideshow

Data structure and algorithms

Data structure and algorithms

Algorithms 1

Algorithms 1

IRJET- A Survey on Different Searching Algorithms

IRJET- A Survey on Different Searching Algorithms

Introduction Computer Science - Software Design.pdf

Mr. K introduces himself as a teacher of IT, computer science, and math who has 20 years of experience in education. He has a master's degree in computer science and has worked as an IT/CS teacher, high school math teacher, and Microsoft Certified Trainer. He is happy to now be teaching at MKIS. The document goes on to prompt students to introduce themselves and ask what they want to learn in the class. It also addresses stereotypes about computer science, explaining that it involves designing complex systems to solve problems, while information technology focuses on using existing technology to meet daily job needs.

Working with files (concepts/pseudocode/python)

The document discusses working with files in software, including reading from and writing to files, different file formats, text files specifically, and provides pseudocode and Python code examples for opening, writing, reading, and closing files. It also covers end-of-line and end-of-file markers that are important for properly reading and writing text files.

Top_down_programming..............................

This document discusses different programming paradigms and how they affect program design. It explains that there are two main paradigms: declarative languages, which describe what to do without specifying how, and imperative languages, which require specifying the exact steps to reach an outcome. It then provides examples of procedural and top-down programming. Top-down design breaks a complex problem down into smaller parts through multiple levels of abstraction. Advantages include reusability. An example walks through designing a grid pattern using top-down pseudocode.

OOP in Python, a beginners guide..........

The hair stylist
would cut the hair
Cook: The cook would cut
the vegetables
So the same word 'Cut' has different meaning depending on the context
This is an example of polymorphism. The same method name can behave
differently for different types of objects.
In OOP, polymorphism allows us to define methods in the child class that
have the same name as the methods in the parent class, but different
implementation.
This allows the child class to inherit the parent's interface while
modifying or extending the parent's functionality.
7/26/2014 VYBHAVA TECHNOLOGIES 27
Operator Overloading
Operator

Structured Query Language introduction..

This document provides an introduction to structured query language (SQL). It discusses SQL's purpose for retrieving and manipulating data from a database. It also explains the different parts of SQL including data manipulation language (DML) for modifying data, data definition language (DDL) for designing databases and tables, and data control language (DCL) for setting user permissions. The document demonstrates writing basic SELECT queries to retrieve data from a database table and uses JOINs to retrieve data from multiple tables. It also shows DML statements for inserting, updating and deleting records in a table.

SDT introduction as given at MKIS, KL, 2023

The document provides an overview of the course objectives for a web design and development class. It will cover:
1. The design cycle process of planning, designing, developing, and deploying a website. Planning involves understanding the users and what information/functionality they need. Designing is creating the look and feel through colors, buttons, menus, etc. Developing is coding the website using languages like HTML, CSS, and JavaScript. Deploying is setting up the website on a server for public access.
2. An explanation of software and hardware, and how websites are considered software since they are sets of coded instructions that computers execute through their hardware components.
3. The three main languages that will

Computer Architecture Machine Cycle (1).pdf

The document discusses the Von Neumann architecture and machine instruction cycle. It explains that software instructions are stored in RAM and fetched by the control unit one at a time to be executed by the ALU. The control unit fetches the next instruction from RAM while the ALU is executing the current one. This repeated fetching and executing of instructions one after another is called the machine instruction cycle. It allows a program comprising multiple instructions to be run sequentially by the CPU.

Referential integrity in databases.pptx

This document outlines an activity to teach students about referential integrity in relational databases. It includes:
- Objectives of being able to write SQL statements and validate data manipulation based on entity relationship diagrams and referential integrity constraints.
- A think-pair-share activity where students are given scenarios and must determine if the data manipulation is valid according to the ERD design before discussing with a partner.
- Examples of data manipulation language statements and scenarios for students to practice validating referential integrity.

Introduction Computer Science - Software Design.pdf

Introduction Computer Science - Software Design.pdf

Working with files (concepts/pseudocode/python)

Working with files (concepts/pseudocode/python)

Top_down_programming..............................

Top_down_programming..............................

OOP in Python, a beginners guide..........

OOP in Python, a beginners guide..........

Structured Query Language introduction..

Structured Query Language introduction..

SDT introduction as given at MKIS, KL, 2023

SDT introduction as given at MKIS, KL, 2023

Computer Architecture Machine Cycle (1).pdf

Computer Architecture Machine Cycle (1).pdf

Referential integrity in databases.pptx

Referential integrity in databases.pptx

All you need to know about Spring Boot and GraalVM

All you need to know about Spring Boot and GraalVM 🐰

WWDC 2024 Keynote Review: For CocoaCoders Austin

Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!

Superpower Your Apache Kafka Applications Development with Complementary Open...

Kafka Summit talk (Bangalore, India, May 2, 2024, https://events.bizzabo.com/573863/agenda/session/1300469 )
Many Apache Kafka use cases take advantage of Kafka’s ability to integrate multiple heterogeneous systems for stream processing and real-time machine learning scenarios. But Kafka also exists in a rich ecosystem of related but complementary stream processing technologies and tools, particularly from the open-source community. In this talk, we’ll take you on a tour of a selection of complementary tools that can make Kafka even more powerful. We’ll focus on tools for stream processing and querying, streaming machine learning, stream visibility and observation, stream meta-data, stream visualisation, stream development including testing and the use of Generative AI and LLMs, and stream performance and scalability. By the end you will have a good idea of the types of Kafka “superhero” tools that exist, which are my favourites (and what superpowers they have), and how they combine to save your Kafka applications development universe from swamploads of data stagnation monsters!

J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...

Presented at NLJUG's J-Spring 2024.

The Comprehensive Guide to Validating Audio-Visual Performances.pdf

Ensuring the optimal performance of your audio-visual (AV) equipment is crucial for delivering exceptional experiences. AV performance validation is a critical process that verifies the quality and functionality of your AV setup. Whether you're a content creator, a business conducting webinars, or a homeowner creating a home theater, validating your AV performance is essential.

Boost Your Savings with These Money Management Apps

A money management app can transform your financial life by tracking expenses, creating budgets, and setting financial goals. These apps offer features like real-time expense tracking, bill reminders, and personalized insights to help you save and manage money effectively. With a user-friendly interface, they simplify financial planning, making it easier to stay on top of your finances and achieve long-term financial stability.

一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理

UMN硕士毕业证成绩单【微信95270640】购买（明尼苏达大学毕业证成绩单硕士学历）Q微信95270640代办UMN学历认证留信网伪造明尼苏达大学学位证书精仿明尼苏达大学本科/硕士文凭证书补办明尼苏达大学 diplomaoffer,Transcript购买明尼苏达大学毕业证成绩单购买UMN假毕业证学位证书购买伪造明尼苏达大学文凭证书学位证书,专业办理雅思、托福成绩单，学生ID卡，在读证明，海外各大学offer录取通知书，毕业证书，成绩单，文凭等材料:1:1完美还原毕业证、offer录取通知书、学生卡等各种在读或毕业材料的防伪工艺（包括 烫金、烫银、钢印、底纹、凹凸版、水印、防伪光标、热敏防伪、文字图案浮雕，激光镭射，紫外荧光，温感光标）学校原版上有的工艺我们一样不会少，不论是老版本还是最新版本，都能保证最高程度还原，力争完美以求让所有同学都能享受到完美的品质服务。
#毕业证成绩单 #毕业証 #成绩单 #學生卡 #OFFER录取通知书 #雅思#托福等……
国外大学明尼苏达大学明尼苏达大学毕业证offer制作方法（一对一专业服务）
1客户提供办理信息：姓名生日专业学位毕业时间等（如信息不确定可以咨询顾问：我们有专业老师帮你查询）；
2开始安排制作毕业证成绩单电子图；
3毕业证成绩单电子版做好以后发送给您确认；
4毕业证成绩单电子版您确认信息无误之后安排制作成品；
5成品做好拍照或者视频给您确认；
6快递给客户（国内顺丰国外DHLUPS等快读邮寄）
— — 制作工艺 【高仿真】— —
凭借多年的制作经验本公司制作明尼苏达大学明尼苏达大学毕业证offer《激光》《水印》《钢印》《烫金》《紫外线》凹凸版uv版等防伪技术一流高精仿度几乎跟学校100%相同！让您绝对满意。
— — -公司理念 【诚信为主】— — —
我們以質量求生存.以服务求发展有雄厚的实力专业的团队咨询顾问为您细心解答可详谈是真是假眼见为实让您真正放心平凡人生,尽我所能助您一臂之力让我們携手圆您梦想!
此贴长年有效【贴心专线/微-信: 95270640】敬请保留此联系方式以备用！如有不在线请给我们留言！我们将在第一时间给您回复!上散发着一抹抹的光晕而这每处自然形成的细节融合在一起浑然天成的美实在令人心生愉悦小道的周边无秩序的生长着几株艳丽的野花红的粉的紫的虽混乱无章却给这幅美景更增添一份性感夹杂着一份纯洁的妖娆毫无违和感实在给人带来一份悠然幸福的心情如果说现在的审美已经断然拒绝了无声的话那么在树林间飞掠而过的小鸟叽叽咋咋的叫声是否就是这最后的点睛之笔悠然走在林间的小路上宁静与清香一丝丝的盛夏气息吸入身体昔日生活里的繁忙多

Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)

Consistent toolbox talks are critical for maintaining workplace safety, as they provide regular opportunities to address specific hazards and reinforce safe practices.
These brief, focused sessions ensure that safety is a continual conversation rather than a one-time event, which helps keep safety protocols fresh in employees' minds. Studies have shown that shorter, more frequent training sessions are more effective for retention and behavior change compared to longer, infrequent sessions.
Engaging workers regularly, toolbox talks promote a culture of safety, empower employees to voice concerns, and ultimately reduce the likelihood of accidents and injuries on site.
The traditional method of conducting safety talks with paper documents and lengthy meetings is not only time-consuming but also less effective. Manual tracking of attendance and compliance is prone to errors and inconsistencies, leading to gaps in safety communication and potential non-compliance with OSHA regulations. Switching to a digital solution like Safelyio offers significant advantages.
Safelyio automates the delivery and documentation of safety talks, ensuring consistency and accessibility. The microlearning approach breaks down complex safety protocols into manageable, bite-sized pieces, making it easier for employees to absorb and retain information.
This method minimizes disruptions to work schedules, eliminates the hassle of paperwork, and ensures that all safety communications are tracked and recorded accurately. Ultimately, using a digital platform like Safelyio enhances engagement, compliance, and overall safety performance on site. https://safelyio.com/

Assure Contact Center Experiences for Your Customers With ThousandEyes

Assure Contact Center Experiences for Your Customers With ThousandEyes

美洲杯赔率投注网【网址🎉3977·EE🎉】

美洲杯赔率投注网【网址🎉3977·EE🎉】

Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform

Alluxio Webinar
June. 18, 2024
For more Alluxio Events: https://www.alluxio.io/events/
Speaker:
- Jianjian Xie (Staff Software Engineer, Alluxio)
As Trino users increasingly rely on cloud object storage for retrieving data, speed and cloud cost have become major challenges. The separation of compute and storage creates latency challenges when querying datasets; scanning data between storage and compute tiers becomes I/O bound. On the other hand, cloud API costs related to GET/LIST operations and cross-region data transfer add up quickly.
The newly introduced Trino file system cache by Alluxio aims to overcome the above challenges. In this session, Jianjian will dive into Trino data caching strategies, the latest test results, and discuss the multi-level caching architecture. This architecture makes Trino 10x faster for data lakes of any scale, from GB to EB.
What you will learn:
- Challenges relating to the speed and costs of running Trino in the cloud
- The new Trino file system cache feature overview, including the latest development status and test results
- A multi-level cache framework for maximized speed, including Trino file system cache and Alluxio distributed cache
- Real-world cases, including a large online payment firm and a top ridesharing company
- The future roadmap of Trino file system cache and Trino-Alluxio integration

如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样

原版定制【微信:bwp0011】《(hull学位证书)英国赫尔大学毕业证硕士文凭》【微信:bwp0011】成绩单 、雅思、外壳、留信学历认证永久存档查询，采用学校原版纸张、特殊工艺完全按照原版一比一制作（包括：隐形水印，阴影底纹，钢印LOGO烫金烫银，LOGO烫金烫银复合重叠，文字图案浮雕，激光镭射，紫外荧光，温感，复印防伪）行业标杆！精益求精，诚心合作，真诚制作！多年品质 ,按需精细制作，24小时接单,全套进口原装设备，十五年致力于帮助留学生解决难题，业务范围有加拿大、英国、澳洲、韩国、美国、新加坡，新西兰等学历材料，包您满意。
【业务选择办理准则】
一、工作未确定，回国需先给父母、亲戚朋友看下文凭的情况，办理一份就读学校的毕业证【微信bwp0011】文凭即可
二、回国进私企、外企、自己做生意的情况，这些单位是不查询毕业证真伪的，而且国内没有渠道去查询国外文凭的真假，也不需要提供真实教育部认证。鉴于此，办理一份毕业证【微信bwp0011】即可
三、进国企，银行，事业单位，考公务员等等，这些单位是必需要提供真实教育部认证的，办理教育部认证所需资料众多且烦琐，所有材料您都必须提供原件，我们凭借丰富的经验，快捷的绿色通道帮您快速整合材料，让您少走弯路。
留信网认证的作用:
1:该专业认证可证明留学生真实身份
2:同时对留学生所学专业登记给予评定
3:国家专业人才认证中心颁发入库证书
4:这个认证书并且可以归档倒地方
5:凡事获得留信网入网的信息将会逐步更新到个人身份内，将在公安局网内查询个人身份证信息后，同步读取人才网入库信息
6:个人职称评审加20分
7:个人信誉贷款加10分
8:在国家人才网主办的国家网络招聘大会中纳入资料，供国家高端企业选择人才
【关于价格问题（保证一手价格）】
我们所定的价格是非常合理的，而且我们现在做得单子大多数都是代理和回头客户介绍的所以一般现在有新的单子 我给客户的都是第一手的代理价格，因为我想坦诚对待大家 不想跟大家在价格方面浪费时间
对于老客户或者被老客户介绍过来的朋友，我们都会适当给一些优惠。

Penify - Let AI do the Documentation, you write the Code.

Penify automates the software documentation process for Git repositories. Every time a code modification is merged into "main", Penify uses a Large Language Model to generate documentation for the updated code. This automation covers multiple documentation layers, including InCode Documentation, API Documentation, Architectural Documentation, and PR documentation, each designed to improve different aspects of the development process. By taking over the entire documentation process, Penify tackles the common problem of documentation becoming outdated as the code evolves.
https://www.penify.dev/

Building API data products on top of your real-time data infrastructure

This talk and live demonstration will examine how Confluent and Gravitee.io integrate to unlock value from streaming data through API products.
You will learn how data owners and API providers can document, secure data products on top of Confluent brokers, including schema validation, topic routing and message filtering.
You will also see how data and API consumers can discover and subscribe to products in a developer portal, as well as how they can integrate with Confluent topics through protocols like REST, Websockets, Server-sent Events and Webhooks.
Whether you want to monetize your real-time data, enable new integrations with partners, or provide self-service access to topics through various protocols, this webinar is for you!

Voxxed Days Trieste 2024 - Unleashing the Power of Vector Search and Semantic...

Vector databases are redefining data handling, enabling semantic searches across text, images, and audio encoded as vectors.
Redis OM for Java simplifies this innovative approach, making it accessible even for those new to vector data.
This presentation explores the cutting-edge features of vector search and semantic caching in Java, highlighting the Redis OM library through a demonstration application.
Redis OM has evolved to embrace the transformative world of vector database technology, now supporting Redis vector search and seamless integration with OpenAI, Hugging Face, LangChain, and LlamaIndex. This talk highlights the latest advancements in Redis OM, focusing on how it simplifies the complex process of vector indexing, data modeling, and querying for AI-powered applications. We will explore the new capabilities of Redis OM, including intuitive vector search interfaces and semantic caching, which reduce the overhead of large language model (LLM) calls.

Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...

Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...The Third Creative Media

"Navigating Invideo: A Comprehensive Guide" is an essential resource for anyone looking to master Invideo, an AI-powered video creation tool. This guide provides step-by-step instructions, helpful tips, and comparisons with other AI video creators. Whether you're a beginner or an experienced video editor, you'll find valuable insights to enhance your video projects and bring your creative ideas to life.WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...

Vector databases are transforming how we handle data, allowing us to search through text, images, and audio by converting them into vectors. Today, we'll dive into the basics of this exciting technology and discuss its potential to revolutionize our next-generation AI applications. We'll examine typical uses for these databases and the essential tools
developers need. Plus, we'll zoom in on the advanced capabilities of vector search and semantic caching in Java, showcasing these through a live demo with Redis libraries. Get ready to see how these powerful tools can change the game!

Orca: Nocode Graphical Editor for Container Orchestration

Tool demo on CEDI/SISTEDES/JISBD2024 at A Coruña, Spain. 2024.06.18
"Orca: Nocode Graphical Editor for Container Orchestration"
by Pedro J. Molina PhD. from Metadev

Going AOT: Everything you need to know about GraalVM for Java applications

Going AOT: Everything you need to know about GraalVM for Java applications

All you need to know about Spring Boot and GraalVM

All you need to know about Spring Boot and GraalVM

WWDC 2024 Keynote Review: For CocoaCoders Austin

WWDC 2024 Keynote Review: For CocoaCoders Austin

Superpower Your Apache Kafka Applications Development with Complementary Open...

Superpower Your Apache Kafka Applications Development with Complementary Open...

J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...

J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...

The Comprehensive Guide to Validating Audio-Visual Performances.pdf

The Comprehensive Guide to Validating Audio-Visual Performances.pdf

Boost Your Savings with These Money Management Apps

Boost Your Savings with These Money Management Apps

一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理

一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理

Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)

Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)

Assure Contact Center Experiences for Your Customers With ThousandEyes

Assure Contact Center Experiences for Your Customers With ThousandEyes

美洲杯赔率投注网【网址🎉3977·EE🎉】

美洲杯赔率投注网【网址🎉3977·EE🎉】

Beginner's Guide to Observability@Devoxx PL 2024

Beginner's Guide to Observability@Devoxx PL 2024

Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform

Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform

如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样

如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样

Penify - Let AI do the Documentation, you write the Code.

Penify - Let AI do the Documentation, you write the Code.

Building API data products on top of your real-time data infrastructure

Building API data products on top of your real-time data infrastructure

Voxxed Days Trieste 2024 - Unleashing the Power of Vector Search and Semantic...

Voxxed Days Trieste 2024 - Unleashing the Power of Vector Search and Semantic...

Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...

Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...

WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...

WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...

Orca: Nocode Graphical Editor for Container Orchestration

Orca: Nocode Graphical Editor for Container Orchestration

Going AOT: Everything you need to know about GraalVM for Java applications

Going AOT: Everything you need to know about GraalVM for Java applications

- 1. SEARCH AND SORT TECHNIQUES FERRY KEMPERMAN NANJING FOREIGN LANGUAGE SCHOOL APRIL 2019
- 2. ALGORITHM DESIGN: EFFICIENCY • As a software designer you have to design algorithms that meet the following two basic requirements: • 1. Works according to specification (correctness) • 2. Works in the most efficient manner • Efficiency of an algorithm is comprised of two main factors: • - Least possible use of resources (CPU/RAM) during execution • - Fastest possible execution of your algorithm When you design an algorithm your design should take efficiency into account, but how?
- 3. HOW TO DESIGN AN EFFICIENT ALGORITHM? A FEW GUIDELINES….. • Minimize RAM usage during execution • Every variable / data structure used is stored in RAM during execution. • Limit the number of variables you use in your algorithm. • Choose the correct datatypes and data structures to store / retrieve values efficiently. • Use the right scoping of variables. How long will variables exist in RAM during execution? • Later more on variable scoping. • Minimize CPU execution time • Basic idea: the fewer instructions, the better. It is not that simple, though. • How many assignments, comparisons etcetera are done during execution? • What kind of expressions are evaluated and how many times? • Every assignment / comparison is an I/O (read/write) operation to memory. Expensive!
- 4. Algorithm’s efficiency…… Fast execution of your algorithm This is completely dependent on your algorithm design! How many loops do you use? How many selections? Is this really necessary? Or can you do with less? A major impact on algorithm efficiency is the way you implement how: - You search for elements in an array (or other data structures) - You sort elements in an array (or other data structures) Searching and sorting algorithms for arrays are well know design techniques in Computer Science. Before introducing them, let’s use a metaphor to understand the importance of this.
- 5. SUPERMARKET METAPHOR • You go to the supermarket to get 1 can of coke. • Strategy 1: Start in the first aisle and look at every product of the shelf to see if it is the can of coke. If not, proceed to second aisle. • Strategy 2: Randomly walk around in the supermarket and try to find the can by looking at the shelves as you pass them. • Strategy 3: Ask clerk for the right aisle with drinks, proceed to this aisle and scan shelves in this aisle to find a can of coke. • Which strategy is the best and why? Which one comes second in terms of efficiency? • Explain your answer in terms of instructions?
- 6. SEARCHING ALGORITHMS: SEQUENTIAL SEARCH • Suppose you have an array comprised of 5 integers • MyArray = [5,3,6,9,10] • You want to find a certain element, say 9, in this array. • The array is unsorted. • You can perform a sequential search by comparing each element in the array to the element you are looking for. • First element 5=9? No. Second 3=9? No, 6=9? No. 9-9? Yes. Element found at position 4. • Basic algorithm, but requires N comparisons, where N is upper bound of array. • Advantage: can be applied to an unsorted array! • Sorting is expensive! • Sequential search is also called linear search.
- 7. SEARCHING ALGORITHMS: BINARY SEARCH • Binary search can only be performed on a sorted array • MyArray = [4,8,12,18,25,30,34] • To find an element, say 30, in a sorted array we can use a binary search. • Instead of starting at the first element, we start in the middle of this array: • Compare your element with the element in the middle, in this case 18. • If this middle element is smaller, compare to middle element on the right, if bigger compare to middle element on the left and so on. • So 18<30, so smaller. Go right. [25,30,34] is the array to the right. Take middle element again. 30=30! • We do not have to compare 30 to ALL the elements of the array. This is a huge gain in terms of efficiency! • Disadvantage: Only sorted arrays can do a binary search, why?
- 9. SORTING ALGORITHMS • Sorting an array can be done in several ways. • We will discuss three famous sorting algorithms:. • Selection Sort • Bubble Sort • Insertion Sort
- 10. SELECTION SORT Take an unsorted array. Put marker on last element N. Search largest element in array. Put largest element in the last position. Move marker to N-1. Search for largest value. Put largest element in position N-1. And so on.
- 11. BUBBLE SORT Start with unsorted array, size N Compare element 1 and 2. If 1 bigger than 2, flip them. Compare element 2 and 3. If 2 bigger than 3, flip them. The largest element is now in Position N. Repeat process for N-1 elements in Step 2. Elements N and N-1 are now In right position. Repeat this in step 3 for N-2 elements. Etcetera.
- 12. INSERTION SORT Start with unsorted array. Take second element and compare with preceding elements and insert it at the right place. Repeat this for third, fourth element until list is sorted.