Directed acyclic graph (DAG) is used to represent the flow of values between basic blocks of code. A DAG is a directed graph with no cycles. It is generated during intermediate code generation. DAGs determine common subexpressions and the flow of names and computed values between blocks of code. An algorithm is described to construct a DAG by creating nodes for operands and adding edges between nodes and operator nodes. Examples show how expressions are represented by a DAG. The complexity of a DAG depends on its width and depth. Applications of DAGs include determining common subexpressions, names used in blocks, and which statements' values may be used outside blocks.
Scala 3 Is Coming: Martin Odersky Shares What To KnowLightbend
Join Dr. Martin Odersky, the creator of Scala and co-founder of Lightbend, on a tour of what is in store and highlight some of his favorite features of Scala 3!
Homework Assignment – Array Technical DocumentWrite a technical .pdfaroraopticals15
Homework Assignment – Array Technical Document
Write a technical document that describes the structure and use of arrays. The document should
be 3 to 5 pages and include an Introduction section, giving a brief synopsis of the document and
arrays, a Body section, describing arrays and giving an annotated example of their use as a
programming construct, and a conclusion to revisit important information about arrays described
in the Body of the document. Some suggested material to include:
Declaring arrays of various types
Array pointers
Printing and processing arrays
Sorting and searching arrays
Multidimensional arrays
Indexing arrays of various dimension
Array representation in memory by data type
Passing arrays as arguments
If you find any useful images on the Internet, you can use them as long as you cite the source in
end notes.
Solution
Array is a collection of variables of the same type that are referenced by a common name.
Specific elements or variables in the array are accessed by means of index into the array.
If taking about C, In C all arrays consist of contiguous memory locations. The lowest address
corresponds to the first element in the array while the largest address corresponds to the last
element in the array.
C supports both single and multi-dimensional arrays.
1) Single Dimension Arrays:-
Syntax:- type var_name[size];
where type is the type of each element in the array, var_name is any valid identifier, and size is
the number of elements in the array which has to be a constant value.
*Array always use zero as index to first element.
The valid indices for array above are 0 .. 4, i.e. 0 .. number of elements - 1
For Example :- To load an array with values 0 .. 99
int x[100] ;
int i ;
for ( i = 0; i < 100; i++ )
x[i] = i ;
To determine to size of an array at run time the sizeof operator is used. This returns the size in
bytes of its argument. The name of the array is given as the operand
size_of_array = sizeof ( array_name ) ;
2) Initialisg array:-
Arrays can be initialised at time of declaration in the following manner.
type array[ size ] = { value list };
For Example :-
int i[5] = {1, 2, 3, 4, 5 } ;
i[0] = 1, i[1] = 2, etc.
The size specification in the declaration may be omitted which causes the compiler to count the
number of elements in the value list and allocate appropriate storage.
For Example :- int i[ ] = { 1, 2, 3, 4, 5 } ;
3) Multidimensional array:-
Multidimensional arrays of any dimension are possible in C but in practice only two or three
dimensional arrays are workable. The most common multidimensional array is a two
dimensional array for example the computer display, board games, a mathematical matrix etc.
Syntax :type name [ rows ] [ columns ] ;
For Example :- 2D array of dimension 2 X 3.
int d[ 2 ] [ 3 ] ;
A two dimensional array is actually an array of arrays, in the above case an array of two integer
arrays (the rows) each with three elements, and is stored row-wise in memory.
For Example :- Program to fill .
This 10 hours class is intended to give students the basis to empirically solve statistical problems. Talk 1 serves as an introduction to the statistical software R, and presents how to calculate basic measures such as mean, variance, correlation and gini index. Talk 2 shows how the central limit theorem and the law of the large numbers work empirically. Talk 3 presents the point estimate, the confidence interval and the hypothesis test for the most important parameters. Talk 4 introduces to the linear regression model and Talk 5 to the bootstrap world. Talk 5 also presents an easy example of a markov chains.
All the talks are supported by script codes, in R language.
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfKamal Acharya
The College Bus Management system is completely developed by Visual Basic .NET Version. The application is connect with most secured database language MS SQL Server. The application is develop by using best combination of front-end and back-end languages. The application is totally design like flat user interface. This flat user interface is more attractive user interface in 2017. The application is gives more important to the system functionality. The application is to manage the student’s details, driver’s details, bus details, bus route details, bus fees details and more. The application has only one unit for admin. The admin can manage the entire application. The admin can login into the application by using username and password of the admin. The application is develop for big and small colleges. It is more user friendly for non-computer person. Even they can easily learn how to manage the application within hours. The application is more secure by the admin. The system will give an effective output for the VB.Net and SQL Server given as input to the system. The compiled java program given as input to the system, after scanning the program will generate different reports. The application generates the report for users. The admin can view and download the report of the data. The application deliver the excel format reports. Because, excel formatted reports is very easy to understand the income and expense of the college bus. This application is mainly develop for windows operating system users. In 2017, 73% of people enterprises are using windows operating system. So the application will easily install for all the windows operating system users. The application-developed size is very low. The application consumes very low space in disk. Therefore, the user can allocate very minimum local disk space for this application.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
More Related Content
Similar to presentation on important DAG,TRIE,Hashing.pptx
Scala 3 Is Coming: Martin Odersky Shares What To KnowLightbend
Join Dr. Martin Odersky, the creator of Scala and co-founder of Lightbend, on a tour of what is in store and highlight some of his favorite features of Scala 3!
Homework Assignment – Array Technical DocumentWrite a technical .pdfaroraopticals15
Homework Assignment – Array Technical Document
Write a technical document that describes the structure and use of arrays. The document should
be 3 to 5 pages and include an Introduction section, giving a brief synopsis of the document and
arrays, a Body section, describing arrays and giving an annotated example of their use as a
programming construct, and a conclusion to revisit important information about arrays described
in the Body of the document. Some suggested material to include:
Declaring arrays of various types
Array pointers
Printing and processing arrays
Sorting and searching arrays
Multidimensional arrays
Indexing arrays of various dimension
Array representation in memory by data type
Passing arrays as arguments
If you find any useful images on the Internet, you can use them as long as you cite the source in
end notes.
Solution
Array is a collection of variables of the same type that are referenced by a common name.
Specific elements or variables in the array are accessed by means of index into the array.
If taking about C, In C all arrays consist of contiguous memory locations. The lowest address
corresponds to the first element in the array while the largest address corresponds to the last
element in the array.
C supports both single and multi-dimensional arrays.
1) Single Dimension Arrays:-
Syntax:- type var_name[size];
where type is the type of each element in the array, var_name is any valid identifier, and size is
the number of elements in the array which has to be a constant value.
*Array always use zero as index to first element.
The valid indices for array above are 0 .. 4, i.e. 0 .. number of elements - 1
For Example :- To load an array with values 0 .. 99
int x[100] ;
int i ;
for ( i = 0; i < 100; i++ )
x[i] = i ;
To determine to size of an array at run time the sizeof operator is used. This returns the size in
bytes of its argument. The name of the array is given as the operand
size_of_array = sizeof ( array_name ) ;
2) Initialisg array:-
Arrays can be initialised at time of declaration in the following manner.
type array[ size ] = { value list };
For Example :-
int i[5] = {1, 2, 3, 4, 5 } ;
i[0] = 1, i[1] = 2, etc.
The size specification in the declaration may be omitted which causes the compiler to count the
number of elements in the value list and allocate appropriate storage.
For Example :- int i[ ] = { 1, 2, 3, 4, 5 } ;
3) Multidimensional array:-
Multidimensional arrays of any dimension are possible in C but in practice only two or three
dimensional arrays are workable. The most common multidimensional array is a two
dimensional array for example the computer display, board games, a mathematical matrix etc.
Syntax :type name [ rows ] [ columns ] ;
For Example :- 2D array of dimension 2 X 3.
int d[ 2 ] [ 3 ] ;
A two dimensional array is actually an array of arrays, in the above case an array of two integer
arrays (the rows) each with three elements, and is stored row-wise in memory.
For Example :- Program to fill .
This 10 hours class is intended to give students the basis to empirically solve statistical problems. Talk 1 serves as an introduction to the statistical software R, and presents how to calculate basic measures such as mean, variance, correlation and gini index. Talk 2 shows how the central limit theorem and the law of the large numbers work empirically. Talk 3 presents the point estimate, the confidence interval and the hypothesis test for the most important parameters. Talk 4 introduces to the linear regression model and Talk 5 to the bootstrap world. Talk 5 also presents an easy example of a markov chains.
All the talks are supported by script codes, in R language.
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfKamal Acharya
The College Bus Management system is completely developed by Visual Basic .NET Version. The application is connect with most secured database language MS SQL Server. The application is develop by using best combination of front-end and back-end languages. The application is totally design like flat user interface. This flat user interface is more attractive user interface in 2017. The application is gives more important to the system functionality. The application is to manage the student’s details, driver’s details, bus details, bus route details, bus fees details and more. The application has only one unit for admin. The admin can manage the entire application. The admin can login into the application by using username and password of the admin. The application is develop for big and small colleges. It is more user friendly for non-computer person. Even they can easily learn how to manage the application within hours. The application is more secure by the admin. The system will give an effective output for the VB.Net and SQL Server given as input to the system. The compiled java program given as input to the system, after scanning the program will generate different reports. The application generates the report for users. The admin can view and download the report of the data. The application deliver the excel format reports. Because, excel formatted reports is very easy to understand the income and expense of the college bus. This application is mainly develop for windows operating system users. In 2017, 73% of people enterprises are using windows operating system. So the application will easily install for all the windows operating system users. The application-developed size is very low. The application consumes very low space in disk. Therefore, the user can allocate very minimum local disk space for this application.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
Democratizing Fuzzing at Scale by Abhishek Aryaabh.arya
Presented at NUS: Fuzzing and Software Security Summer School 2024
This keynote talks about the democratization of fuzzing at scale, highlighting the collaboration between open source communities, academia, and industry to advance the field of fuzzing. It delves into the history of fuzzing, the development of scalable fuzzing platforms, and the empowerment of community-driven research. The talk will further discuss recent advancements leveraging AI/ML and offer insights into the future evolution of the fuzzing landscape.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
Courier management system project report.pdfKamal Acharya
It is now-a-days very important for the people to send or receive articles like imported furniture, electronic items, gifts, business goods and the like. People depend vastly on different transport systems which mostly use the manual way of receiving and delivering the articles. There is no way to track the articles till they are received and there is no way to let the customer know what happened in transit, once he booked some articles. In such a situation, we need a system which completely computerizes the cargo activities including time to time tracking of the articles sent. This need is fulfilled by Courier Management System software which is online software for the cargo management people that enables them to receive the goods from a source and send them to a required destination and track their status from time to time.
2. DIRECTED ACYCLIC GRAPH(DAG)
The Directed Acyclic Graph (DAG) is used to represent the structure of basic blocks, to visualize the
flow of values between basic blocks.
A directed acyclic graph is a directed graph that has no cycles.
A DAG is a three-address code that is generated as the result of an intermediate code generation.
Determines common subexpressions.
Leaves are labelled by variables names or constraints initial values are subscripted with 0.
Interior nodes are operators and internal nodes are also represent result of the expressions.
4. ALGORITHM FOR CONSTRUCTION OF DIRECTED
ACYCLIC GRAPH
• Case 1 – x = y op z
Case 2 – x = op y
Case 3 – x = y
• Directed Acyclic Graph for the above cases can be built as follows :
• Step 1 –
• If the y operand is not defined, then create a node (y).
• If the z operand is not defined, create a node for case(1) as node(z).
• Step 2 –
• Create node(OP) for case(1), with node(z) as its right child and node(OP) as its left child (y).
• For the case (2), see if there is a node operator (OP) with one child node (y).
• Node n will be node(y) in case (3).
• Step 3 –
Remove x from the list of node identifiers. Step 2: Add x to the list of attached identifiers for node n.
5. APPLICATIONS OF DAG
• Directed acyclic graph determines the subexpressions that are commonly used.
• Directed acyclic graph determines the names used within the block as well as the names
computed outside the block.
• Determines which statements in the block may have their computed value outside the
block.
• Code can be represented by a Directed acyclic graph that describes the inputs and outputs
of each of the arithmetic operations performed within the code.
• Several programming languages describe value systems that are linked together by a
directed acyclic graph.
6. EXAMPLE 1:
Example : 1
T0 = a + b Expression 1
T1 = T0 + c Expression 2
d = T0 + T1 Expression 3
Expression 1: T0 = a + b
10. COMPLEXITY OF DIRECTED ACYCLIC GRAPH
• A DAG having "width" and "depth" is more complex than a DAG having only
"width" or only "depth": E←D←A→B→C is more complex than A→B→C→D→E
or the graph with edges from A to each of B,C,D, and E.
• The sum of the sizes of the adjacency lists of all nodes in a directed graph is E.
Thus, for a directed graph, the time complexity is O(V) + O(E) = O(V + E). In an
undirected graph, each edge appears twice. Once at either end of the adjacency
list for the edge
12. Overview
History & Definition
Types of tries
Standard Tries
Compressed Tries
Suffix Tries
Conclusion
13. History
The term trie comes from retrieval.
This term was coined by Edward Fredkin, who pronounce it tri as in
the word retrieval
14. Definition of tries
A data structure for representing a collection of strings.
In computer science, a trie. Also called digital tree and sometimes
radix tree or prefix tree.
Tries support fast pattern matching
15. Properties of a tries
A multi-way tree.
Each node has from 1 to n children.
Each edge of the tree is labeled with a character.
Each leaf nodes correspond to the stored string, which is a
concatenation of characters on a path from the root to this node.
16. Standard tries
The standard trie for a set of strings S is an ordered tree such that:
Each node labeled with a character but not root node.
The children of a node are alphabetically ordered.
The paths from the external nodes to the root yield the strings of S.
18. Example of Standard tries
Example: Standard trie for the set of strings.
S = { bear, bell, bid, bull, buy, sell, stock, stop }
19. Handling keys (strings)
When a key (string) is a prefix of another key.
How can we know that “an” is a word?
Example: an, and
20. Handling keys (strings)
We add a special termination symbol ”$”.
We append the “$” to each keyword.
Strings = {an, and, any, at}
21. Standard Tries - Searching
Search hit: Node where search ends has a $ symbol.
Search - sea
22. Standard Tries - Deletion
3 cases
1. Word not found……!
2. Word exists as a strand alone word.
3. Word exists as a prefix of another word.
23. Standard Tries - Deletion
Word not found.
return false
Word exists as a stand alone word
part of any other word
does not a part of any other word
24. Standard Tries - Deletion
Part of any other word.
Deletion - sea
25. Standard Tries - Deletion
Does not a part of any other word.
Deletion - set
26. Standard Tries - Deletion
Word exists as a prefix of any other word.
Deletion - an
27. Compressed Tries
Tries with nodes of degree atleast 2.
Obtained by standard tries by compressing chains of redundant
nodes.
28. Compressed Tries - Example
In order to understand Compressed Trie we need to see the Standard
Trie Example.
30. Suffix Tries
A suffix trie is a compressed trie for all the suffixes of a text.
Suffix trie are a space-efficient data structure to store a string that
allows many kinds of queries to be answered quickly.
32. Example of Suffix Tries
After alphabetically ordered the trie will look like.
33. Understanding Requirements
Insertion is faster as compared to the Hash Table.
Lookup is much more faster than Hash Table implementations.
There are no collision of different keys in tries.
36. Dictionaries
Dictionaries stores elements so that they can be located quickly
using keys.
For e.g.
A Dictionary may hold bank accounts.
In which key will be account number.
And each account may stores many additional information.
37. How to Implement a Dictionary?
Different data structure to realize a key
o Array, Linked list
o Binary tree
o Hash table
o Red/Black tree
o AVL Tree
o B-Tree
38. Why Hashing??
The sequential search algorithm takes time proportional to the data size, i.e. O(n).
Binary search improves on linear search reducing the search time to O(log n).
With a BST, an O(log n) search efficiency can be obtained; but the worst-case
complexity is O(n).
To guarantee the O(log n) search time, BST height balancing is required (i.e., AVL
trees).
39. Why Hashing?? (Cntd.)
Suppose that we want to store 10,000 students records (each with a 5-digit ID) in a
given container.
A linked list implementation would take O(n) time.
A height balanced tree would give O(log n) access time.
Using an array of size 100,000 would give O(1) access time but
will lead to a lot of space wastage.
40. Why Hashing?? (Cntd.)
Is there some way that we could get O(1) access without
wasting a lot of space?
The answer is
HASHING.
41. Hashing
Another important and widely useful technique for implementing
dictionaries.
Constant time per operation (on the average).
Like an array, come up with a function to map the large range into one
which we can manage.
42. Basic Idea
Use hash function to map keys into positions in a
hash table.
Ideally
If Student a has ID(Key) k and h is hash function, then A’S details is stored in
position h(k) of table.
To search for A, compute h(k) to locate position. If no element, dictionary doesn’t
contain A.
47. 4.
Analysis:
Successful Search
N=100(Keys) Hash Table Size=10
λ = N/Size, where λ is known as Loading Factor
λ = 100/10 = 10 at each location there are 10 keys (assuming)
Average Time taken for successful search:
T = 1 + λ /2
Time for unsuccessful search:
T = 1 + λ
48. Example:
Keys – 5, 45, 35, 55, 65, 75, 85, 875, 955, 555, 5555
All locate at index 5
Who is responsible??
Need the Hash Function that can Uniformly
Distribute the keys
49. Hash Functions
A Good Hash function is one which distribute keys evenly among the slots.
And it is said that Hash Function is more art than a science. Because it need to
analyze the data.
50. Hash Function (contd.)
Need of choose a good Hash function
Quick Compute
Distribute Keys in uniform manner throughout the table.
How to deal with Hashing non integer Key???
1. Find some way of turning keys into integer.
eg if key is in character then convert it into integer using ASCII
2. Then use standard Hash Function on the integer.
51. Hash Function (contd.)
The Mapping of keys to indices of a hash table is called a hash function.
The Hash Function is usually the composition of two maps.
Hash code map
Keys Integer
Compression map
Integer A[o…….m-1]
52. Linear Probing
26
30
45
23
25
43
74
19
29
H(x)=x%10
0 30
1 29
2
3 23
4 43
5 45
6 26
7 25
8 74
9 19
H’(X) = (H(X) + F(i)) % 10 where F(i) = I
i = 0,1,2,3,4,….
H’(25) = (((25%10) + 0)%10))=5 “got collision”
H’(25) = (((25%10) + 1)%10))=6 “got collision”
H’(25) = (((25%10) + 2)%10))=7 “no collision”
1. Insert
2. Search
3. Delete
Search linearly until key is found OR found
free space.
53. 4. Analysis:
Average Time taken for successful search:
T = 1/ λ + ln(1/1- λ)
Time for unsuccessful search:
T = 1/1-λ
Searching is time consuming.
In linear probing deletion is not suggested.
Collision is not resolved.
54. Linear Probe(contd.)
If the current location is used, Try the next table location.
Used less memory than chaining as one does not have to store all those link (i.e. address of
others).
Slower than chaining as one might have to walk along the table for a long time.
56. 4. Analysis:
Average Time taken for successful search:
T = - (loge
(1- λ)/ λ)
Time for unsuccessful search:
T = 1/1-λ
Searching is time consuming.
Collision is not resolved.
Keys are uniformly distributed.
57. Double Hashing:
Resolve collision
Has two basic hash function
Second hash function have two desired property:
It should never give a result zero or index=0.
It should try to probe all the locations means whenever there is collision, it should not give the indices in the
same pattern. It should give different indices such that the location are utilized. Hence, hash function should
be with prime number.
Second hash function can be modified by keeping in mind its desired properties.
58. Double Hashing:
H1
(x) = x % 10
H2
(x) = R – (x % R) where, R is a prime number just smaller than the size of hash table.
For example, if the size of hash table is 9 then the value of R = 7.
H’(x) = ((H1
(x) + i * H2
(x)) % 10
We use H1
(x) hash function for insertion of keys but if got collision then use H’(x) hash
function or modified hash function.
60. Different Hash Function
1.Mod: (key % number)
2.Mid Square: square the key and choose index = mid value of
square(for odd number) and mid two digit as index (for even
numbers).
o Let key is 13 then (13)2
=169 then index would be 6 to store the key 13.
o Let key is 35 then (35)2
=1225 then index would be 22 to store the key 35.
3. Folding: add the numbers of a key (123456 = 1+2+3+4+5+6)
and addition of the number would be the index to store the key (21).