Here are the algorithms in pseudocode:
1. Find largest number of unknown set:
- Read first number and assign to largest
- Read next number
- If number is greater than largest, assign it to largest
- Repeat step 2 until no more numbers
- Output largest
2. Find average of numbers:
- Read number of elements n
- Initialize sum = 0
- Initialize i = 0
- Repeat while i < n
- Read element at array[i]
- Add element to sum
- Increment i
- Calculate average = sum / n
- Output average
Algorithm Analysis
Computational Complexity
Introduction to Basic Data
Structures
Graph Theory
Graph Algorithms
Greedy Algorithms
Divide and Conquer
Dynamic Programming
Introduction to Linear Programming
Flow Network
Algorithm Analysis
Computational Complexity
Introduction to Basic Data
Structures
Graph Theory
Graph Algorithms
Greedy Algorithms
Divide and Conquer
Dynamic Programming
Introduction to Linear Programming
Flow Network
A data structure is a storage that is used to store and organize data. It is a way of arranging data on a computer so that it can be accessed and updated efficiently. A data structure is not only used for organizing the data. It is also used for processing, retrieving, and storing data. That entire data can be represented using an object and can be used throughout the program.
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
More Related Content
Similar to lec_4_data_structures_and_algorithm_analysis.ppt
A data structure is a storage that is used to store and organize data. It is a way of arranging data on a computer so that it can be accessed and updated efficiently. A data structure is not only used for organizing the data. It is also used for processing, retrieving, and storing data. That entire data can be represented using an object and can be used throughout the program.
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
Launch Your Streaming Platforms in MinutesRoshan Dwivedi
The claim of launching a streaming platform in minutes might be a bit of an exaggeration, but there are services that can significantly streamline the process. Here's a breakdown:
Pros of Speedy Streaming Platform Launch Services:
No coding required: These services often use drag-and-drop interfaces or pre-built templates, eliminating the need for programming knowledge.
Faster setup: Compared to building from scratch, these platforms can get you up and running much quicker.
All-in-one solutions: Many services offer features like content management systems (CMS), video players, and monetization tools, reducing the need for multiple integrations.
Things to Consider:
Limited customization: These platforms may offer less flexibility in design and functionality compared to custom-built solutions.
Scalability: As your audience grows, you might need to upgrade to a more robust platform or encounter limitations with the "quick launch" option.
Features: Carefully evaluate which features are included and if they meet your specific needs (e.g., live streaming, subscription options).
Examples of Services for Launching Streaming Platforms:
Muvi [muvi com]
Uscreen [usencreen tv]
Alternatives to Consider:
Existing Streaming platforms: Platforms like YouTube or Twitch might be suitable for basic streaming needs, though monetization options might be limited.
Custom Development: While more time-consuming, custom development offers the most control and flexibility for your platform.
Overall, launching a streaming platform in minutes might not be entirely realistic, but these services can significantly speed up the process compared to building from scratch. Carefully consider your needs and budget when choosing the best option for you.
In the ever-evolving landscape of technology, enterprise software development is undergoing a significant transformation. Traditional coding methods are being challenged by innovative no-code solutions, which promise to streamline and democratize the software development process.
This shift is particularly impactful for enterprises, which require robust, scalable, and efficient software to manage their operations. In this article, we will explore the various facets of enterprise software development with no-code solutions, examining their benefits, challenges, and the future potential they hold.
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...informapgpstrackings
Keep tabs on your field staff effortlessly with Informap Technology Centre LLC. Real-time tracking, task assignment, and smart features for efficient management. Request a live demo today!
For more details, visit us : https://informapuae.com/field-staff-tracking/
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
1. Some slides are borrowed from Mr. Mohammad Alqahtani
•Overview.
•Algorithm Analysis.
2. Be familiar with problem solving.
Be able to develop (and implement) algorithms.
Be able to trace algorithms.
Be able to select appropriate data structures and
algorithms for given problems.
3. Prerequisites:
◦ Variables and expressions.
◦ Methods (functions or procedures ).
◦ Decision structures( like if-statements and
switch-statements.
◦ Iteration structures (for-loops and while-loops).
◦ Classes and objects
4. Data
◦ A collection of facts from which conclusion may be drawn.
◦ e.g. Data: Temperature 35°C; Conclusion: It is hot.
Types of data
◦ Textual: For example, your name (Alya)
◦ Numeric: For example, your ID (090254)
◦ Audio: For example, your voice
◦ Video: For example, your voice and picture
◦ (...)
5. 5
Applications/programs read data, store data
temporarily, process it and finally output
results.
What is data? Numbers, Characters, etc.
Application/
Program
Data Data
6. 6
Data is classified into data types. e.g. char, float, int, etc.
A data type is (i) a domain of allowed values and (ii) a set
of operations on these values.
Compiler signals an error if wrong operation is performed
on data of a certain type. For example, char x,y,z; z =
x*y is not allowed.
7. 7
Examples
Data Type Domain Operations
boolean 0,1 and, or, =, etc.
char ASCII =, <>, <, etc.
integer -maxint to
+maxint
+, _, =, ==,
<>, <, etc.
8. 8
Simple Data types: also known as atomic data
types have no component parts. E.g. int,
char, float, etc.
21 3.14 ‘a’
9. A particular way of storing and organizing data in a
computer so that it can be used efficiently and
effectively.
Data structure is the logical or mathematical model of
a particular organization of data.
A group of data elements grouped together under one
name.
◦ For example, an array of integers
10. 10
Structured Data types: can be broken into
component parts. E.g. an object, array, set,
file, etc. Example: a student object.
A H M A D
20
C S C
Name
Age
Branch
A Component part
11. There are many, but we named a few. We’ll learn these
data structures in great detail!
Array
Linked List
Tree
Queue Stack
Types of Data Structures
12. Goal: to organize data
Criteria: to facilitate efficient
◦ storage of data
◦ retrieval of data
◦ manipulation of data
Design Issue:
◦ select and design appropriate data types
(This is the main motivation to learn and
understand data structures)
13. (Demonstrate using class room
example!)
Navigating
Accessing each data element exactly once so
that certain items in the data may be processed
Searching
Finding the location of the data element (key)
in the structure
Insertion
Adding a new data element to the structure
14. Deletion
◦ Removing a data element from the structure
Sorting
◦ Arrange the data elements in a logical order
(ascending/descending)
Merging
◦ Combining data elements from two or more
data structures into one
15. A finite set of instructions which accomplish a particular
task
A method or process to solve a problem
Transforms input of a problem to output
Algorithm = Input + Process + Output
Algorithm development is an art – it needs practice, practice
and only practice!
16. It must be correct
It must be finite (in terms of time and size)
It must terminate
It must be unambiguous
Which step is next?
It must be space and time efficient
A program is an instance of an algorithm, written in some
specific programming language
17. Problem: Find maximum of a, b, c
Algorithm
Input = a, b, c
Output = max
Process
o Let max = a
o If b > max then
max = b
o If c > max then
max = c
o Display max
Order is very important!!!
18. Clearly identify:
what output is required?
what is the input?
What steps are required to transform input into
output
o The most crucial bit
o Needs problem solving skills
o A problem can be solved in many different ways
o Which solution, amongst the different possible
solutions is optimal?
19. A sequence of steps to solve a problem
We need a way to express this sequence of steps
1. Natural language (NL) is an obvious choice, but not
a good choice. Why?
o NLs are notoriously ambiguous (unclear)
2. Programming language (PL) is another choice, but
again not a good choice. Why?
o Algorithm should be PL independent
We need some balance
o We need PL independence
o We need clarity
o Pseudo-code provides the right balance
20. Pseudo-code is a short hand way of describing a
computer program
Rather than using the specific syntax of a
computer language, more general wording is used
It is a mixture of NL and PL expressions, in a
systematic way
Using pseudo-code, it is easier for a non-
programmer to understand the general workings of
the program
21. Use PLs construct that are consistent with
modern high level languages, e.g. C++,
Java, ...
Use appropriate comments for clarity
Be simple and precise
22. Expressions
Standard mathematical symbols are used
o Left arrow sign (←) as the assignment operator in assignment statements
(equivalent to the = operator in Java)
o Equal sign (=) as the equality relation in Boolean expressions (equivalent to the "=
=" relation in Java)
o For example
Sum ← 0
Sum ← Sum + 5
What is the final value of sum?
23. Decision structures (if-then-else logic)
if condition then
true-actions
[else
false-actions]
We use indentation to indicate what actions should be included in the true-
actions and false-actions
For example
if marks > 50 then
print “Congratulation, you are passed!”
else
print “Sorry, you are failed!”
end if
What will be the output if marks are equal to 75?
24. Loops (Repetition)
◦ Pre-condition loops
o While loops
while condition do actions
We use indentation to indicate what actions should be included in
the loop actions
For example
while counter < 5 do
print “Welcome to CS204!”
counter ← counter + 1
end while
What will be the output if counter is initialised to 0, 7?
25. Loops (Repetition)
◦ Pre-condition loops
o For loops
for variable-increment-definition do actions
For example
for counter ← 0; counter < 5; counter ← counter + 2 do
print “Welcome to CS204!”
end for
What will be the output?
26. Loops (Repetition)
Post-condition loops
o Do loops
do actions while condition
For example
do
print “Welcome to CS204!”
counter ← counter + 1
while counter < 5
What will be the output, if counter was initialised to 10?
The body of a post-condition loop must execute at least once
27. Method declarations
◦ Return_type method_name (parameter_list)
method_body
◦ For example
integer sum ( integer num1, integer num2)
start
result ← num1 + num2
end
Method calls
object.method (args)
For example
mycalculator.sum(num1, num2)
28. Method returns
return value
For example
integer sum ( integer num1, integer num2)
start
result ← num1 + num2
return result
end
29. Comments
◦ /* Multiple line comments go here. */
◦ // Single line comments go here
◦ Some people prefer braces {}, for comments
Arrays
A[i] represents the ith cell in the array A.
The cells of an n-celled array A are indexed from A[0] to A[n −
1] (consistent with Java).
30. Example 1: Determining even/odd number
A number divisible by 2 is considered an even number, while a
number which is not divisible by 2 is considered an odd number.
Write pseudo-code to display first N odd/even numbers.
Example 2: Computing Weekly Wages
Gross pay depends on the pay rate and the number of hours
worked per week. However, if you work more than 40 hours, you
get paid time-and-a-half for all hours worked over 40. Write the
pseudo-code to compute gross pay given pay rate and hours
worked
31. Input range
for num←0; num<=range; num←num+1 do
if num % 2 = 0 then
print num is even
else
print num is odd
endif
endfor
32. Example 1: Determining even/odd number
◦ A number divisible by 2 is considered an even number, while
a number which is not divisible by 2 is considered an odd
number. Write pseudo-code to display first N odd/even
numbers.
Example 2: Computing Weekly Wages
Gross pay depends on the pay rate and the number of hours
worked per week. However, if you work more than 40 hours,
you get paid time-and-a-half for all hours worked over 40.
Write the pseudo-code to compute gross pay given pay rate and
hours worked
33. Input range
for num←0; num<=range; num←num+1 do
if num % 2 = 0 then
print num is even
else
print num is odd
endif
endfor
34. Input hours_worked, pay_rate
if hours_worked <= 40 then
gross_pay ← pay_rate x hours_worked
else
basic_pay ← pay_rate x 40
over_time ← hours_worked – 40
over_time_pay ← 1.5 x pay_rate x over_time
gross_pay ← basic_pay + over_time_pay
endfor
print gross_pay
35. 1. Write an algorithm to find the largest
of a set of numbers. You do not know
the number of numbers.
2. Write an algorithm in pseudocode
that finds the average of (n) numbers.
For example numbers are [4,5,14,20,3,6]s