linear search and binary search, Class lecture of Data Structure and Algorithms and Python.
Stack, Queue, Tree, Python, Python Code, Computer Science, Data, Data Analysis, Machine Learning, Artificial Intellegence, Deep Learning, Programming, Information Technology, Psuedocide, Tree, pseudocode, Binary Tree, Binary Search Tree, implementation, Binary search, linear search, Binary search operation, real-life example of binary search, linear search operation, real-life example of linear search, example bubble sort, sorting, insertion sort example, stack implementation, queue implementation, binary tree implementation, priority queue, binary heap, binary heap implementation, object-oriented programming, def, in BST, Binary search tree, Red-Black tree, Splay Tree, Problem-solving using Binary tree, problem-solving using BST, inorder, preorder, postorder
linear search and binary search, Class lecture of Data Structure and Algorithms and Python.
Stack, Queue, Tree, Python, Python Code, Computer Science, Data, Data Analysis, Machine Learning, Artificial Intellegence, Deep Learning, Programming, Information Technology, Psuedocide, Tree, pseudocode, Binary Tree, Binary Search Tree, implementation, Binary search, linear search, Binary search operation, real-life example of binary search, linear search operation, real-life example of linear search, example bubble sort, sorting, insertion sort example, stack implementation, queue implementation, binary tree implementation, priority queue, binary heap, binary heap implementation, object-oriented programming, def, in BST, Binary search tree, Red-Black tree, Splay Tree, Problem-solving using Binary tree, problem-solving using BST, inorder, preorder, postorder
Divide and Conquer Algorithms - D&C forms a distinct algorithm design technique in computer science, wherein a problem is solved by repeatedly invoking the algorithm on smaller occurrences of the same problem. Binary search, merge sort, Euclid's algorithm can all be formulated as examples of divide and conquer algorithms. Strassen's algorithm and Nearest Neighbor algorithm are two other examples.
Algorithms Lecture 1: Introduction to AlgorithmsMohamed Loey
We will discuss the following: Algorithms, Time Complexity & Space Complexity, Algorithm vs Pseudo code, Some Algorithm Types, Programming Languages, Python, Anaconda.
This is the second lecture in the CS 6212 class. Covers asymptotic notation and data structures. Also outlines the coming lectures wherein we will study the various algorithm design techniques.
Introduction to Algorithms and Asymptotic NotationAmrinder Arora
Asymptotic Notation is a notation used to represent and compare the efficiency of algorithms. It is a concise notation that deliberately omits details, such as constant time improvements, etc. Asymptotic notation consists of 5 commonly used symbols: big oh, small oh, big omega, small omega, and theta.
Divide and Conquer Algorithms - D&C forms a distinct algorithm design technique in computer science, wherein a problem is solved by repeatedly invoking the algorithm on smaller occurrences of the same problem. Binary search, merge sort, Euclid's algorithm can all be formulated as examples of divide and conquer algorithms. Strassen's algorithm and Nearest Neighbor algorithm are two other examples.
Algorithms Lecture 1: Introduction to AlgorithmsMohamed Loey
We will discuss the following: Algorithms, Time Complexity & Space Complexity, Algorithm vs Pseudo code, Some Algorithm Types, Programming Languages, Python, Anaconda.
This is the second lecture in the CS 6212 class. Covers asymptotic notation and data structures. Also outlines the coming lectures wherein we will study the various algorithm design techniques.
Introduction to Algorithms and Asymptotic NotationAmrinder Arora
Asymptotic Notation is a notation used to represent and compare the efficiency of algorithms. It is a concise notation that deliberately omits details, such as constant time improvements, etc. Asymptotic notation consists of 5 commonly used symbols: big oh, small oh, big omega, small omega, and theta.
My Presentation of Graduation Project
'Library Management System'
using vb.net 2008 and sql server 2008
2013
CS & IT department
faculty of Science
Portsaid Univeristy
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
2. Algorithm
● the Latin form of Al-Khw?rizm .
● Algorithm:is well-defined computation
procedure that takes some value,or set of
values, as input and produces some value
, or set of values,as output.
● a sequence of computational steps that
transfer the input into the output
● a tool for solving a well-specified
computional problem
3. Example of Algorithms :
● when you need to sort asequence of
numbers into nondecreasing order
(31,42,59,26,58)
Input:A sequence of n numbers
(instance of program) (31,42,59,26,58).
Output:A reordering of the input
sequence (26,31,42,58,59).
4. Solve this problem with python:
def sort(a,n):
i=0
for i in range(n):
min=i
m=i+1
for m in range(n):
if a[m]<a[min]:
min=m
temp=a[i]
a[i]=a[min]
a[min]=temp
5. Computer algorithms :
● in computer systems, an algorithm is
basically an instance of logic written
in software by software developers
to be effective for the target
computer, in order for the target
machines to produce output from
given input .
6. Why computer algorithms are important ?
● The topic of algorithms is important in
computer science because it allows for
analysis on different ways to compute
things and ultimately come up with the best
way to solve a particular problem. By best I
mean one that consumes the least amount of
resources or has the fastest running time.
7. What Kinds of problems are solved by
algorithms?
● The Human Genome Project : made a
great progress toward the goals of
identifying all the 100.000 genes in human
DNA determining the sequences of the 3
billion chemical base pairs that make up
human DNA ,sorting the information in
databases,and developing tools for data
analysis.Each of these steps requires
algorithms.
8. What Kinds of problems are solved by
algorithms?
● The Internet enables people around the
world to quick access and retrieve large
amounts of information.
● Electronic commerce enables goods and
services to be exchanged electronically.
● Manufacturing and other commerical
enterprises need to allocate rescources in
the most beneficial way.
9. Advantages of "Python" as a
Programming Language
● Python is an interpreted, high-level programming
language, pure object-oriented, and powerful
server-side scripting language for the Web. Like
all scripting languages, Python code resembles
pseudo code. Its syntax's rules and elegant design
make it readable even among multiprogrammer
development teams.
10. Advantages of "Python" as a
Programming Language :
Readability :
● Python's syntax is clear and readable.
● Python has fewer "dialects" than other l
languages, such as Perl. And because the
block structures in Python are defined by
indentations
11. Advantages of "Python" as a
Programming Language :
It Is Simple to Get Support :
● Python community always provides support
to Python users.
● Python code is freely available for everyone.
● many people are creating new
enhancements to the language and sending
them for approval
12. Advantages of "Python" as a
Programming Language :
Fast to Learm .
Fast to Code :
● Python provides fast feedback in several
ways.
● Python provides a bottom-up development
style in which you can build your
applications by importing and testing critical
functions in the interpreter before you write
the top-level code that calls the functions.
13. Advantages of "Python" as a
Programming Language :
Reusability :
● You can easily share functionality between
your programs by breaking the programs
into modules, and reusing the modules as
components of other programs.
14. Advantages of "Python" as a
Programming Language :
Portability :
● Besides running on multiple systems, Python
has the same interface on multiple
platforms. Its design isn't attached to a
specific operational system because it is
written in portable ANSI C. This means that
you can write a Python program on a Mac,
test it using a Linux environment, and
upload it to a Windows server.
15. Advantages of "Python" as a
Programming Language :
Object-Oriented Programming :
● Some of the implemented OO functionality in
Python is inheritance and polymorphism.
16. Examples of "Python based Solutions" for
different "Computer Algorithms " ..
17. SEARCHING :
● The operation of finding the location LOC of
ITEM in DATA, or printing some message
that ITEM does not appear there.
● There are many differtent serarching
algorithms :
The algorithm deponds on the way the
information in DATA is organized.
18. Linear Search :
● Known as sequential search
● is a method for finding a particular
value in alist,
that consists of checking every one of
its elements,
one at a time and in sequence, until the
desired one is found.
19. linear search:
#linear search in python:
def linear_search (a,n,item):
k=0
for k in range(n):
if item ==a[k]:
loc=k
return loc
20. the disadvantages of linear search :
● in linear search it needs more space and
time complexity.
● in linear search if the key element is the last
element and the search is from first element
that is a worst case, if the key element is the
first element and the search is from last
element then also is the worst case.
21. Best, Worst and Average
Cases :
● Worst case :- O(n)
● Average case :- O(n).
22. binary search :
● Suppose DATA ia an array which i
stored in increasing numerical order or
alphabetically.
Then There are an extremely efficient
searching algorithm , called binary search,
That can be used to find the location LOC
of a given ITEM of information in DATA.
24. Binary Search :
def binary_search(data,n,lb,ub,item):
beg=lb
end=up
mid=(beg+end)/2
while beg<=end and data[mid]!=item:
if item<data[mid]:
end=mid-1
else:
beg=mid+1
mid=(beg+end)/2
25. Binary Search :
if data[mid]==item:
loc=mid
else :
loc=-1
return loc
26. Best, Worst and Average
cases :
● Worst case :- O(log2 n).
● Average case :- O(log2 n).
27. The Binary Search Algorithm
works as follows :
● During each stage of our algorithm, our search
for ITEM is reduced to a segment of element of
DATA: DATA[BEG],DATA[BEG+1],.............,
DATA[END]
● The algorithm compares ITEM with the middle
element DATA[MID] of the segment
MID=((BEG+END)/2)
28. The Binary Search Algorithm
works as follows :
● If ITEM < DATA[MID], then ITEM can appear
only in the left half of the segment:
DATA[BEG],DATA[BEG+1],.............,
DATA[MID-1]
-reset END=MID-1.
● If ITEM > DATA[MID], then ITEM can appear
only in the right half of the segment::
DATA[MID+1],DATA[MID+2],...........,DATA[END].
-reset BEG=MID+1.
29. Limitations of the Binary Search
Algorithm :
● -The Binary Search Algorithm requires
two conditions:
(1) the list must be sorted.
(2) direct access to the middle element in any
sublist.
30. Limitations of the Binary Search
Algorithm :
● keeping data in sorted array is normally
very expensive when there are many
insertions and deletions.
● Thus one may use a different data structure
such as linked list or a binary search tree
31. Sorting :
● Sorting : is the process of rearranging the
data in array or list in insreasing or
decreasing order .
32. Insertion Sort :
● Simple sorting algorithim .
● Ii is very popular when first sorting .
● Efficient for sorting small data .
(more efficient than bubble and selection sort)
● Slow for sorting large data, thus Time can
be saved by performing a binary search to
find the location in which insert data[i] in
the in input array .
● Online : can sort input array as it recevied .
33. Insertion Sort :
● insertion sort works as follows :
■ removes an element from the input
data, inserting it into the correct
position , to find the correct position we
compare this element with each
element in the input array, from right to
left, until no input elements remain.
34.
35. Insertion Sorting :
def InsertionSort(data,n):
for j in range(1,n):
key = data[j]
i=j-1
while (data[i] > key):
data[i+1] = data[i]
i=i-1
data[i+1] = key
36. Best, Worst and Average
Cases :
The Best Case:
in which the input array was already
sorted .This gives Inserting Sort linear
running time O(n).
● The Worst Case :
in which the input array was sorted in
reverse order .This gives Inserting Sort
quadratic running time O(n2).
● The Average Case : O(n2) .
37. Selection Sort :
● Selection sort works as follows :
● Find the location loc of the smallest
element in input array and put it in
the first position, find the location
loc of the second smallest element
and put it in the second position,
And so on .
38.
39. Selection Sort :
def sort(a,n):
i=0
for i in range(n):
min=i
m=i+1
for m in range(n):
if a[m]<a[min]:
min=m
temp=a[i]
a[i]=a[min]
a[min]=temp
40. Best, Worst and Average
Cases :
● Best case : O(n2) .
● Worst case : O(n2) .
● Average case : O(n2) .
41. Merge Sort :
● Merge sort : a divide and conquer algorithm
that was invented by John von Neumann in
1945.
42. Merge Sort :
● Merge Sort works as follows :
● Divide the unsorted list into n
sublists, repeatedly merge sublists
to produce new sublists until each
sublist contain one element .
(list of one element consider sorted )
43.
44. Best, Worst and Average
Cases :
● Best case : O(n log n) .
● Worst case : O(n log n) .
● Average case : O(n log n) .