Searching Lesson Plan - 6. Contents Evocation Objective Introduction Sequential Search Algorithm Variations on sequential search Mind map Summary.

Презентация:



Advertisements
Похожие презентации
UNIT-III SORTING Lesson Plan-1 Insertion Sort, Selection Sort.
Advertisements

Trees, Binary Tree and Binary Search Tree Lesson Plan - 1.
1/27 Chapter 9: Template Functions And Template Classes.
Tree Transversals Lesson Plan - 2. Contents Evocation Objective Introduction Binary Tree Transversals Mind map Summary.
AVL( Georgy Adelson-Velsky and Landis) Tree Lesson Plan - 3.
SPLAY TREE The basic idea of the splay tree is that every time a node is accessed, it is pushed to the root by a series of tree rotations. This series.
DEPTH FIRST TRAVERSAL Lesson Plan -2. Evocation Traverse Graph All vertices in graph must to traverse A vertex in graph have multiple parents, traversal.
BREADTH FIRST TRAVERSAL Lesson Plan -3. Evocation.
Sequences Sequences are patterns. Each pattern or number in a sequence is called a term. The number at the start is called the first term. The term-to-term.
REFERENCE ELEMENTS 64. If your REFERENCE ELEMENTS toolbar is not in view and not hidden, you can retrieve it from the toolbars menu seen here. 65.
UNIT 2. Introduction to Computer Programming. COM E 211: Basic Computer Programming UNIT 2. Introduction to Computer Programming Algorithm & Flowcharting.
AVL-Trees COMP171 Fall AVL Trees / Slide 2 Balanced binary tree * The disadvantage of a binary search tree is that its height can be as large as.
Collision Resolution Lesson Plan - 9. Contents Evocation Objective Introduction Collision Resolution Separate Chaining Open addressing Linked list Bucket.
© 2006 Cisco Systems, Inc. All rights reserved. CVOICE v Configuring Voice Networks Configuring Dial Peers.
While its always a good idea to think outside the box when approaching a creative task, this is not always the case. For example, when working with teams,
Time-Series Analysis and Forecasting – Part IV To read at home.
Combination. In mathematics a combination is a way of selecting several things out of a larger group, where (unlike permutations) order does not matter.
DRAFTING TECHNIQUES II 155. Auxiliary Views Auxiliary Views are easily made. When more specific detail of a part is needed, go to the VIEWS toolbar, then.
Hashing Lesson Plan - 8. Contents Evocation Objective Introduction General idea Hash Tables Types of Hashing Hash function Hashing methods Hashing algorithm.
Love And Marriage. You choose what life you would like to have You are a creator of your life. It can be a wonderful happy marriage or… Or you can get.
Транксрипт:

Searching Lesson Plan - 6

Contents Evocation Objective Introduction Sequential Search Algorithm Variations on sequential search Mind map Summary

ANNEXURE-I Evocation

Evocation

Objective To learn the basics of sequential search algorithm To understand about the variations on sequential search

ANNEXURE-II Introduction -Sequential Search Searching is the process used to find location of target among a list of objects Example: Table of Employee Record Two basic searches for arrays are sequential search and binary search Sequential search is used to locate items in any array Binary search requires an ordered list

Sequential Search Sequential search is used whenever list is not ordered Start searching for the target at the beginning of list and continue until it finds the target or hits at the end of list Search algorithm requires four parameters List we are searching Index to last element in list Target Address where the found elements index location is to be stored

Successful Search of Unordered List

Unsuccessful Search of Unordered List

Sequential Search Algorithm

ANNEXURE-III Yoga Breathing Mudra

Yoga Breathing Mudra Enhances effortless breathing while gently balances five chakras Place your fingers in this position Thumb, middle, little finger gently pressed together (palm to palm) Both index fingers move behind the middle finger (dont strain) Right ring finger in front of left (increases inhale in 80% of people) Left ring finger in front of right (increase exhale in 80% of people) Whenever you inhale or exhale change the position of your ring finger Now allow yourself to breathe into your abdomen first with the breath flowing like a wave opening up your chest Allow your shoulders to remain relaxed. As you exhale, smile

Optical illusion Is the center square of stars standing still or moving?

Logo identification

Hidden Picture Puzzles

Variations on Sequential Search Three useful variations in sequential search algorithm are Sentinel search Probability search Ordered list search Sentinel Search Knuth states, when inner loop of program test two or more conditions, we should try to reduce testing to just one condition Target is put in list by adding extra element at end of array and place the target in sentinel Optimize the loop and determine after loop completes whether actual data found or sentinel

Variations on Sequential Search Probability Search Data in array are arranged with most probable search elements at beginning of array and least probable at end If probability ordering is correct over time, in each search exchange located element with element immediately before in array Ordered list search Search ordered list sequentially, it is not necessary to search to end of list to determine the target is not in the list Stop the target become less than or equal to current element we are testing

Sentinel Search Algorithm int find(int* a, int l, int v) { a[l] = v; // add sentinel value for (i = 0; ; i++) if (a[i] == v) { if (i == l) // sentinel value, not real result return -1; return i; }

Probability Search INPUT: list[] : reference of interger array last : index of last item target: target to be found ref_locn: reference to the location of target OUT: If target is found location of target is stored in ref_locn found = 1 is returned target is moved up in priority Else last is stored in ref_locn found = 0 is returned

Ordered List Search Algorithm OrderedListSearch(list, last, target, locn) if (target less than last element in list) find first element less than or equal to target set locn to index of element else set locn to last end if if (target in list) set found to true else set found to false end if return found end OrderedListSearch

Search Algorithm Advantages Easy algorithm to understand Array can be any order Easy to implement Can be used on very small data sets Not practical for searching large collections Disadvantage Inefficient (slow) for array of N elements, examine N/2 elements on average for value in array, N elements for value not in array

ANNEXURE-IV Mind Map Sequential Search Successful Search of Unordered list Unsuccessful Search of Unordered list Algorithm Variations of Sequential Search Sentinel Search Probability Search Ordered List Search

ANNEXURE-V Summary Searching is the process used to find location of target among a list of objects There are two basic methods for searching arrays: sequential search and binary search Sequential search is normally used when list is not sorted Starts at beginning of list and searches until it finds data or hits end of list

Summary In sentinel search, condition will end the search is reduced to only one by inserting target at end of list In probability search, list is sorted with most probable elements at beginning of list and least probable at end In order list search, it is not necessary to search to end of list to determine the target is not in the list