Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Slide advlow memory algorithm
1. A Presentation on Memory Effcient Algorithms
April 2019 CSE6408
Student ID:0419052090
Bangladesh University of Engineering and Technology
July 2, 2019
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 1 / 36
2. Low Memory Algorithm
Motivation
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 2 / 36
3. Low Memory Algorithm
Motivation
In-place Model
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 2 / 36
4. Low Memory Algorithm
Motivation
In-place Model
Read-Only Model
Time Interval Problem
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 2 / 36
5. Low Memory Algorithm
Motivation
In-place Model
Read-Only Model
Time Interval Problem
Snake/Snail Problem
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 2 / 36
6. Low Memory Algorithm
Motivation
In-place Model
Read-Only Model
Time Interval Problem
Snake/Snail Problem
Cycle Counting Problem
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 2 / 36
7. Objective:
Objective of memory efficient algorithm is to reduce working storeage
requirement in the expense of limited inefficiency in the running time.
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 3 / 36
8. In-place-Model:
Input data can be changed during the execution and after execution
each object is in the input array
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 4 / 36
9. Read-Only-Model:
Input data structure is read only memory that is input data structure
remains unchanged after execution.Here we solve all the problem
using Read-only-Model.
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 5 / 36
10. Time Interval Problem
Problem Definition:
Suppose you are working for a company. You are now looking at a
list of monthly profit and loss and wonder when the company was
best. To measure the company’s commercial activity, you can define
the total amount of profit for consecutive months.
month 1 2 3 4 5 6 7 8 9 10 11 12
profit 4 -3 5 -7 9 -2 5 -7 9 -2 -5 6
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 6 / 36
11. Algorithm 1
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 7 / 36
12. Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 8 / 36
13. Algorithm 1
Time complexity O(n2)
Space complexity O(n2)
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 9 / 36
14. Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 10 / 36
15. Algorithm 2
Time complexity O(n2)
Space complexity O(n)
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 11 / 36
17. Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 13 / 36
18. Algorithm 3
Time complexity O(n)
Space complexity O(n)
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 14 / 36
19. Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 15 / 36
20. Lemma
Given a list of profit and loss for n months in a read-only array,
Algorithm 4 finds the best time interval in O(n) time without using
an extra array.
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 16 / 36
21. Snake or Snail: Detection of a Cycle Problem
Problem Definition:
Suppose we have a linked list with single pointers. Given a pointer to
the head of such a linked-list, we want to determine whether it
contains a cycle or not.
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 17 / 36
22. Snake
When we traverse the list one after another,if NULL is found at any
point the it will be considered as ”Snake”.
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 18 / 36
23. Snail
If the exist a cycle in the list then it will be considered as ”Snail”.
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 19 / 36
24. Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 20 / 36
25. Algorithm 1
Time complexity O(n2)
Space complexity O(n)
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 21 / 36
26. Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 22 / 36
27. Algorithm 2
Time complexity O(n)
Space complexity O(n)
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 23 / 36
28. Algorithm 3:The Tortoise and Hare Algorithm
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 24 / 36
29. Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 25 / 36
30. Algorithm 3
Time complexity O(n)
Space complexity O(1)
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 26 / 36
31. Lemma
Algorithm T and H correctly determine snake/snail distinction of a
given list containing n list elements in O(n) time using only O(1)
working space.
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 27 / 36
32. Cycle Counting Problem
Problem Definition:
Given a 2-regular graph G by a sequence of n pairs on integers
between 1 and n on a read-only array, give an efficient algorithm
which counts the number of cycles in G using only constant work
space.
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 28 / 36
33. 2-Regular Graph:
A 2-Regular Graph is a regular graph where number of degree of each
vertex is 2 i.e,each vertex has 2 edge.
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 29 / 36
34. Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 30 / 36
35. Algorithm 1
Time complexity O(n)
Space complexity O(n)
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 31 / 36
36. Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 32 / 36
37. Algorithm 2
Time complexity O(n2)
Space complexity O(1)
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 33 / 36
38. Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 34 / 36
39. Algorithm 3
Time complexity O(nlogn)
Space complexity O(1)
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 35 / 36
40. Thank You!
Student ID:0419052090 (Bangladesh University of Engineering and Technology)A Presentation on Memory Effcient Algorithms July 2, 2019 36 / 36