The document discusses linear probing as an open addressing technique for hash tables. It describes linear probing as placing an identifier in the next empty slot after its home bucket if a collision occurs. The document provides an example to demonstrate linear probing. It also discusses linear probing with chaining, where a chain of collided elements is maintained through pointers rather than replacing elements. Pseudocode for insertion and searching in linear probing tables is provided.
Double hashing uses two hash functions, h1 and h2. If h1 causes a collision, h2 is used to compute an increment to probe for the next empty slot. Common definitions for h2 include h2(key)=1+key%(tablesize) or h2(key)=M-(key%M) where M is a prime smaller than the table size. Quadratic probing probes locations using the formula h(key)=[h(key)+i^2]%table_size. Rehashing doubles the table size when the load factor exceeds 0.75, reinserting all elements to maintain a low load factor.
This document contains a lab manual for data structures programming. It outlines various exercises including representing sparse matrices using arrays and linked lists, implementing stack and queue data structures using arrays and linked lists, and performing operations on singly, doubly and circular linked lists. It also covers binary tree traversals, binary search tree implementation and operations, and algorithms including heap sort, quick sort, depth first search, breadth first search and Dijkstra's algorithm.
This document outlines a lab manual for a Data Structures and Algorithms course. The lab covers basic operations on arrays in C++, including insertion, deletion, traversal, and searching algorithms. It provides pseudocode and C++ code examples for inserting and deleting elements from an array, traversing a linear array, and using linear and binary search algorithms. The objectives are to understand array operations, write algorithms, and implement them in code using the Dev C++ tool.
1) Separate chaining is an open hashing technique that uses linked lists to handle collisions. Each index in the hash table points to the head of a linked list of records with the same hash value.
2) Operations like search, insert and delete have average time complexity of O(1+α) where α is the load factor, as records are stored in linked lists after hashing.
3) Advantages are it never fills up and is less sensitive to hash function quality, while disadvantages include poorer cache performance than open addressing and wasted space due to unused indexes.
The document describes an experiment on linear search in C programming. It explains the theory of linear search through pseudocode. The program allows the user to input elements into an array, search for a target element, and output whether the element was found and its position. It searches each element sequentially until a match is found or the whole array is traversed. Sample runs show it finding and not finding elements correctly.
This document provides an overview of advanced data structures and algorithm analysis taught by Dr. Sukhamay Kundu at Louisiana State University. It discusses the role of data structures in making computations faster by supporting efficient data access and storage. The document distinguishes between algorithms, which determine the computational steps and data access order, and data structures, which enable efficient reading and writing of data. It also describes different methods for measuring algorithm performance, such as theoretical time complexity analysis and empirical measurements. Examples are provided for instrumenting code to count operations. Overall, the document introduces fundamental concepts about algorithms and data structures.
Merge sort analysis and its real time applicationsyazad dumasia
The document provides an analysis of the merge sort algorithm and its applications in real-time. It begins with introducing sorting and different sorting techniques. Then it describes the merge sort algorithm, explaining the divide, conquer, and combine steps. It analyzes the time complexity of merge sort, showing that it has O(n log n) runtime. Finally, it discusses some real-time applications of merge sort, such as recommending similar products to users on e-commerce websites based on purchase history.
Double hashing uses two hash functions, h1 and h2. If h1 causes a collision, h2 is used to compute an increment to probe for the next empty slot. Common definitions for h2 include h2(key)=1+key%(tablesize) or h2(key)=M-(key%M) where M is a prime smaller than the table size. Quadratic probing probes locations using the formula h(key)=[h(key)+i^2]%table_size. Rehashing doubles the table size when the load factor exceeds 0.75, reinserting all elements to maintain a low load factor.
This document contains a lab manual for data structures programming. It outlines various exercises including representing sparse matrices using arrays and linked lists, implementing stack and queue data structures using arrays and linked lists, and performing operations on singly, doubly and circular linked lists. It also covers binary tree traversals, binary search tree implementation and operations, and algorithms including heap sort, quick sort, depth first search, breadth first search and Dijkstra's algorithm.
This document outlines a lab manual for a Data Structures and Algorithms course. The lab covers basic operations on arrays in C++, including insertion, deletion, traversal, and searching algorithms. It provides pseudocode and C++ code examples for inserting and deleting elements from an array, traversing a linear array, and using linear and binary search algorithms. The objectives are to understand array operations, write algorithms, and implement them in code using the Dev C++ tool.
1) Separate chaining is an open hashing technique that uses linked lists to handle collisions. Each index in the hash table points to the head of a linked list of records with the same hash value.
2) Operations like search, insert and delete have average time complexity of O(1+α) where α is the load factor, as records are stored in linked lists after hashing.
3) Advantages are it never fills up and is less sensitive to hash function quality, while disadvantages include poorer cache performance than open addressing and wasted space due to unused indexes.
The document describes an experiment on linear search in C programming. It explains the theory of linear search through pseudocode. The program allows the user to input elements into an array, search for a target element, and output whether the element was found and its position. It searches each element sequentially until a match is found or the whole array is traversed. Sample runs show it finding and not finding elements correctly.
This document provides an overview of advanced data structures and algorithm analysis taught by Dr. Sukhamay Kundu at Louisiana State University. It discusses the role of data structures in making computations faster by supporting efficient data access and storage. The document distinguishes between algorithms, which determine the computational steps and data access order, and data structures, which enable efficient reading and writing of data. It also describes different methods for measuring algorithm performance, such as theoretical time complexity analysis and empirical measurements. Examples are provided for instrumenting code to count operations. Overall, the document introduces fundamental concepts about algorithms and data structures.
Merge sort analysis and its real time applicationsyazad dumasia
The document provides an analysis of the merge sort algorithm and its applications in real-time. It begins with introducing sorting and different sorting techniques. Then it describes the merge sort algorithm, explaining the divide, conquer, and combine steps. It analyzes the time complexity of merge sort, showing that it has O(n log n) runtime. Finally, it discusses some real-time applications of merge sort, such as recommending similar products to users on e-commerce websites based on purchase history.
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
International Journal of Engineering Research and Development (IJERD)IJERD Editor
journal publishing, how to publish research paper, Call For research paper, international journal, publishing a paper, IJERD, journal of science and technology, how to get a research paper published, publishing a paper, publishing of journal, publishing of research paper, reserach and review articles, IJERD Journal, How to publish your research paper, publish research paper, open access engineering journal, Engineering journal, Mathemetics journal, Physics journal, Chemistry journal, Computer Engineering, Computer Science journal, how to submit your paper, peer reviw journal, indexed journal, reserach and review articles, engineering journal, www.ijerd.com, research journals,
yahoo journals, bing journals, International Journal of Engineering Research and Development, google journals, hard copy of journal
The document discusses the design of combinational logic circuits using Boolean algebra. It covers topics such as converting English descriptions to Boolean equations, using truth tables to derive switching functions, minterm and maxterm expansions, incompletely specified functions, and designing binary adders including ripple carry adders and carry lookahead adders. The goals are to specify circuit behaviors using Boolean algebra and design combinational logic circuits from algebraic expressions or truth tables.
Basics in algorithms and data structure Eman magdy
The document discusses data structures and algorithms. It notes that good programmers focus on data structures and their relationships, while bad programmers focus on code. It then provides examples of different data structures like trees and binary search trees, and algorithms for searching, inserting, deleting, and traversing tree structures. Key aspects covered include the time complexity of different searching algorithms like sequential search and binary search, as well as how to implement operations like insertion and deletion on binary trees.
Linear searching scans each element of an array one-by-one to find a target value. It has a time complexity of O(n) as the worst case is scanning all elements. Binary search recursively halves the search space to find a target value in a sorted array in O(log n) time on average. Hashing maps elements to array indices using a hash function, allowing constant time lookups. Collisions occur when distinct elements hash to the same index, and are resolved using chaining or linear probing.
This document summarizes a slide presentation on string methods and debugging in Java. It provides examples of common string methods like charAt, compareTo, indexOf, replace, and substring. It also briefly explains how to debug programs using breakpoints and stepping through code line-by-line.
The document discusses counting sort, a linear time sorting algorithm. Counting sort runs in O(n) time when the integers being sorted are in the range of 1 to k, where k is O(n). It works by counting the number of elements less than or equal to each unique input element, and using this to directly place each element in the correct position of the output array. Pseudocode and an example are provided to demonstrate how counting sort iterates through the input, counts the occurrences of each unique element, and uses this to sort the elements into the output array in linear time. However, counting sort has limitations and may not be practical for large datasets due to its required extra storage space.
Merge sort is a sorting algorithm that works by dividing an array into two halves, recursively sorting the halves, and then merging the sorted halves into a single sorted array. The document provides details on how merge sort works, including pseudocode for the main, merge sort, and merging functions. It analyzes the time complexity of merge sort as O(n log n), making it more efficient than other basic sorts with O(n^2) time complexity like bubble, selection, and insertion sort.
This presentation contain almost everything about the algorithms- its definition, designing, complexity analysis, running time calculations, common sorting and searching algorithms with their running time and examples.
This document contains information about a Data Structures and Algorithms course taught by Associate Professor Yusuf Sahillioğlu at Middle East Technical University. It provides details about the course instructor, textbook, grading breakdown, course outline covering topics like sorting, lists, trees and graphs, and motivational examples demonstrating how data structures can be used to efficiently store and process data. It also includes an introduction to programming in C++ covering object-oriented concepts like classes, objects, encapsulation and information hiding.
This document contains information about a Data Structures and Algorithms course taught by Professor Yusuf Sahillioğlu at Middle East Technical University. It provides details about the course objectives, textbook, grading breakdown, course outline covering topics like sorting, lists, trees and graphs, and motivational examples demonstrating how data structures can be used to efficiently store and process data. It also introduces some basic C++ concepts like classes, objects, encapsulation and information hiding that will be used in the course.
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...Tosin Amuda
Sorting is a fundamental operation in computer science (many programs use it as an intermediate step), and as a result a large number of good sorting algorithms have been developed. Which algorithm is best for a given application depends on—among other factors—the number of items to be sorted, the extent to which the items are already somewhat sorted, possible restrictions on the item values, and the kind of storage device to be used: main memory, disks, or tapes.
There are three reasons to study sorting algorithms. First, sorting algorithms illustrate many creative approaches to problem solving, and these approaches can be applied to solve other problems. Second, sorting algorithms are good for practicing fundamental programming techniques using selection statements, loops, methods, and arrays. Third, sorting algorithms are excellent examples to demonstrate algorithm performance.
However, this paper attempt to compare the practical efficiency of three sorting algorithms – Insertion, Quick and mere Sort using empirical analysis. The result of the experiment shows that insertion sort is a quadratic time sorting algorithm and that it’s more applicable to subarray that is sufficiently small. The merge sort performs better with larger size of input as compared to insertion sort. Quicksort runs the most efficiently.
This document contains lecture notes on the design and analysis of algorithms. It covers topics like algorithm definition, complexity analysis, divide and conquer algorithms, greedy algorithms, dynamic programming, and NP-complete problems. The notes provide examples of algorithms like selection sort, towers of Hanoi, and generating permutations. Pseudocode is used to describe algorithms precisely yet readably.
1. Recursion is a programming technique where a method calls itself to solve smaller instances of the same problem. This document discusses examples of using recursion to calculate triangular numbers, factorials, binary search, and the Towers of Hanoi puzzle.
2. Mergesort is presented as a recursive algorithm for sorting an array. It works by recursively splitting the array in half and merging the sorted halves.
3. Various examples of Java programs are provided that implement recursive solutions to problems like calculating triangular numbers, factorials, binary search, Towers of Hanoi, and mergesort.
This document discusses algorithms for sorting and searching data. It introduces basic data structures like arrays and linked lists. Different sorting algorithms are described like insertion sort, shell sort, and quicksort. Dictionaries that allow efficient insertion, search and deletion are also covered, including hash tables, binary search trees, red-black trees, and skip lists. The document provides pseudocode for the algorithms and estimates their time complexity using Big O notation. Source code implementations of the algorithms in C and Visual Basic are available for download.
SCS-MCSA- Based Architecture for Montgomery Modular MultiplicationIRJET Journal
The document describes a modified architecture for Montgomery modular multiplication that uses a modified carry save adder (MCSA) to improve performance. The MCSA allows for faster pre-computation and format conversion steps in the Montgomery algorithm compared to using a configurable carry save adder. The proposed SCS-MCSA based Montgomery modular multiplier was implemented on a Xilinx FPGA and achieved lower hardware cost and shorter critical path delay than previous designs. Simulation results showed it requires fewer logic resources and completes a modular multiplication in 8.203 nanoseconds.
IOSR journal of VLSI and Signal Processing (IOSRJVSP) is a double blind peer reviewed International Journal that publishes articles which contribute new results in all areas of VLSI Design & Signal Processing. The goal of this journal is to bring together researchers and practitioners from academia and industry to focus on advanced VLSI Design & Signal Processing concepts and establishing new collaborations in these areas.
Design and realization of microelectronic systems using VLSI/ULSI technologies require close collaboration among scientists and engineers in the fields of systems architecture, logic and circuit design, chips and wafer fabrication, packaging, testing and systems applications. Generation of specifications, design and verification must be performed at all abstraction levels, including the system, register-transfer, logic, circuit, transistor and process levels
Arrays allow storing and manipulating a collection of related data elements. They can hold groups of integers, characters, or other data types. Declaring individual variables becomes difficult when storing many elements, so arrays provide an efficient solution. Arrays are declared with a datatype and size, and elements can be initialized, accessed, inserted, deleted, and manipulated using their index positions. Common array operations include displaying values, finding maximum/minimum values, calculating sums, and passing arrays to functions. Multi-dimensional arrays extend the concept to store elements in a table structure accessed by row and column indexes.
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
International Journal of Engineering Research and Development (IJERD)IJERD Editor
journal publishing, how to publish research paper, Call For research paper, international journal, publishing a paper, IJERD, journal of science and technology, how to get a research paper published, publishing a paper, publishing of journal, publishing of research paper, reserach and review articles, IJERD Journal, How to publish your research paper, publish research paper, open access engineering journal, Engineering journal, Mathemetics journal, Physics journal, Chemistry journal, Computer Engineering, Computer Science journal, how to submit your paper, peer reviw journal, indexed journal, reserach and review articles, engineering journal, www.ijerd.com, research journals,
yahoo journals, bing journals, International Journal of Engineering Research and Development, google journals, hard copy of journal
The document discusses the design of combinational logic circuits using Boolean algebra. It covers topics such as converting English descriptions to Boolean equations, using truth tables to derive switching functions, minterm and maxterm expansions, incompletely specified functions, and designing binary adders including ripple carry adders and carry lookahead adders. The goals are to specify circuit behaviors using Boolean algebra and design combinational logic circuits from algebraic expressions or truth tables.
Basics in algorithms and data structure Eman magdy
The document discusses data structures and algorithms. It notes that good programmers focus on data structures and their relationships, while bad programmers focus on code. It then provides examples of different data structures like trees and binary search trees, and algorithms for searching, inserting, deleting, and traversing tree structures. Key aspects covered include the time complexity of different searching algorithms like sequential search and binary search, as well as how to implement operations like insertion and deletion on binary trees.
Linear searching scans each element of an array one-by-one to find a target value. It has a time complexity of O(n) as the worst case is scanning all elements. Binary search recursively halves the search space to find a target value in a sorted array in O(log n) time on average. Hashing maps elements to array indices using a hash function, allowing constant time lookups. Collisions occur when distinct elements hash to the same index, and are resolved using chaining or linear probing.
This document summarizes a slide presentation on string methods and debugging in Java. It provides examples of common string methods like charAt, compareTo, indexOf, replace, and substring. It also briefly explains how to debug programs using breakpoints and stepping through code line-by-line.
The document discusses counting sort, a linear time sorting algorithm. Counting sort runs in O(n) time when the integers being sorted are in the range of 1 to k, where k is O(n). It works by counting the number of elements less than or equal to each unique input element, and using this to directly place each element in the correct position of the output array. Pseudocode and an example are provided to demonstrate how counting sort iterates through the input, counts the occurrences of each unique element, and uses this to sort the elements into the output array in linear time. However, counting sort has limitations and may not be practical for large datasets due to its required extra storage space.
Merge sort is a sorting algorithm that works by dividing an array into two halves, recursively sorting the halves, and then merging the sorted halves into a single sorted array. The document provides details on how merge sort works, including pseudocode for the main, merge sort, and merging functions. It analyzes the time complexity of merge sort as O(n log n), making it more efficient than other basic sorts with O(n^2) time complexity like bubble, selection, and insertion sort.
This presentation contain almost everything about the algorithms- its definition, designing, complexity analysis, running time calculations, common sorting and searching algorithms with their running time and examples.
This document contains information about a Data Structures and Algorithms course taught by Associate Professor Yusuf Sahillioğlu at Middle East Technical University. It provides details about the course instructor, textbook, grading breakdown, course outline covering topics like sorting, lists, trees and graphs, and motivational examples demonstrating how data structures can be used to efficiently store and process data. It also includes an introduction to programming in C++ covering object-oriented concepts like classes, objects, encapsulation and information hiding.
This document contains information about a Data Structures and Algorithms course taught by Professor Yusuf Sahillioğlu at Middle East Technical University. It provides details about the course objectives, textbook, grading breakdown, course outline covering topics like sorting, lists, trees and graphs, and motivational examples demonstrating how data structures can be used to efficiently store and process data. It also introduces some basic C++ concepts like classes, objects, encapsulation and information hiding that will be used in the course.
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...Tosin Amuda
Sorting is a fundamental operation in computer science (many programs use it as an intermediate step), and as a result a large number of good sorting algorithms have been developed. Which algorithm is best for a given application depends on—among other factors—the number of items to be sorted, the extent to which the items are already somewhat sorted, possible restrictions on the item values, and the kind of storage device to be used: main memory, disks, or tapes.
There are three reasons to study sorting algorithms. First, sorting algorithms illustrate many creative approaches to problem solving, and these approaches can be applied to solve other problems. Second, sorting algorithms are good for practicing fundamental programming techniques using selection statements, loops, methods, and arrays. Third, sorting algorithms are excellent examples to demonstrate algorithm performance.
However, this paper attempt to compare the practical efficiency of three sorting algorithms – Insertion, Quick and mere Sort using empirical analysis. The result of the experiment shows that insertion sort is a quadratic time sorting algorithm and that it’s more applicable to subarray that is sufficiently small. The merge sort performs better with larger size of input as compared to insertion sort. Quicksort runs the most efficiently.
This document contains lecture notes on the design and analysis of algorithms. It covers topics like algorithm definition, complexity analysis, divide and conquer algorithms, greedy algorithms, dynamic programming, and NP-complete problems. The notes provide examples of algorithms like selection sort, towers of Hanoi, and generating permutations. Pseudocode is used to describe algorithms precisely yet readably.
1. Recursion is a programming technique where a method calls itself to solve smaller instances of the same problem. This document discusses examples of using recursion to calculate triangular numbers, factorials, binary search, and the Towers of Hanoi puzzle.
2. Mergesort is presented as a recursive algorithm for sorting an array. It works by recursively splitting the array in half and merging the sorted halves.
3. Various examples of Java programs are provided that implement recursive solutions to problems like calculating triangular numbers, factorials, binary search, Towers of Hanoi, and mergesort.
This document discusses algorithms for sorting and searching data. It introduces basic data structures like arrays and linked lists. Different sorting algorithms are described like insertion sort, shell sort, and quicksort. Dictionaries that allow efficient insertion, search and deletion are also covered, including hash tables, binary search trees, red-black trees, and skip lists. The document provides pseudocode for the algorithms and estimates their time complexity using Big O notation. Source code implementations of the algorithms in C and Visual Basic are available for download.
SCS-MCSA- Based Architecture for Montgomery Modular MultiplicationIRJET Journal
The document describes a modified architecture for Montgomery modular multiplication that uses a modified carry save adder (MCSA) to improve performance. The MCSA allows for faster pre-computation and format conversion steps in the Montgomery algorithm compared to using a configurable carry save adder. The proposed SCS-MCSA based Montgomery modular multiplier was implemented on a Xilinx FPGA and achieved lower hardware cost and shorter critical path delay than previous designs. Simulation results showed it requires fewer logic resources and completes a modular multiplication in 8.203 nanoseconds.
IOSR journal of VLSI and Signal Processing (IOSRJVSP) is a double blind peer reviewed International Journal that publishes articles which contribute new results in all areas of VLSI Design & Signal Processing. The goal of this journal is to bring together researchers and practitioners from academia and industry to focus on advanced VLSI Design & Signal Processing concepts and establishing new collaborations in these areas.
Design and realization of microelectronic systems using VLSI/ULSI technologies require close collaboration among scientists and engineers in the fields of systems architecture, logic and circuit design, chips and wafer fabrication, packaging, testing and systems applications. Generation of specifications, design and verification must be performed at all abstraction levels, including the system, register-transfer, logic, circuit, transistor and process levels
Arrays allow storing and manipulating a collection of related data elements. They can hold groups of integers, characters, or other data types. Declaring individual variables becomes difficult when storing many elements, so arrays provide an efficient solution. Arrays are declared with a datatype and size, and elements can be initialized, accessed, inserted, deleted, and manipulated using their index positions. Common array operations include displaying values, finding maximum/minimum values, calculating sums, and passing arrays to functions. Multi-dimensional arrays extend the concept to store elements in a table structure accessed by row and column indexes.
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...University of Maribor
Slides from talk presenting:
Aleš Zamuda: Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapter and Networking.
Presentation at IcETRAN 2024 session:
"Inter-Society Networking Panel GRSS/MTT-S/CIS
Panel Session: Promoting Connection and Cooperation"
IEEE Slovenia GRSS
IEEE Serbia and Montenegro MTT-S
IEEE Slovenia CIS
11TH INTERNATIONAL CONFERENCE ON ELECTRICAL, ELECTRONIC AND COMPUTING ENGINEERING
3-6 June 2024, Niš, Serbia
Literature Review Basics and Understanding Reference Management.pptxDr Ramhari Poudyal
Three-day training on academic research focuses on analytical tools at United Technical College, supported by the University Grant Commission, Nepal. 24-26 May 2024
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELgerogepatton
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSIJNSA Journal
The smart irrigation system represents an innovative approach to optimize water usage in agricultural and landscaping practices. The integration of cutting-edge technologies, including sensors, actuators, and data analysis, empowers this system to provide accurate monitoring and control of irrigation processes by leveraging real-time environmental conditions. The main objective of a smart irrigation system is to optimize water efficiency, minimize expenses, and foster the adoption of sustainable water management methods. This paper conducts a systematic risk assessment by exploring the key components/assets and their functionalities in the smart irrigation system. The crucial role of sensors in gathering data on soil moisture, weather patterns, and plant well-being is emphasized in this system. These sensors enable intelligent decision-making in irrigation scheduling and water distribution, leading to enhanced water efficiency and sustainable water management practices. Actuators enable automated control of irrigation devices, ensuring precise and targeted water delivery to plants. Additionally, the paper addresses the potential threat and vulnerabilities associated with smart irrigation systems. It discusses limitations of the system, such as power constraints and computational capabilities, and calculates the potential security risks. The paper suggests possible risk treatment methods for effective secure system operation. In conclusion, the paper emphasizes the significant benefits of implementing smart irrigation systems, including improved water conservation, increased crop yield, and reduced environmental impact. Additionally, based on the security analysis conducted, the paper recommends the implementation of countermeasures and security approaches to address vulnerabilities and ensure the integrity and reliability of the system. By incorporating these measures, smart irrigation technology can revolutionize water management practices in agriculture, promoting sustainability, resource efficiency, and safeguarding against potential security threats.
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
1. Sanjivani Rural Education Society’s
Sanjivani College of Engineering, Kopargaon-423 603
(An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune)
NACC ‘A’ Grade Accredited, ISO 9001:2015 Certified
Department of Computer Engineering
(NBA Accredited)
Subject- Data Structures-I(CO203)
Unit III- Closed Hashing
2. • Open Addressing/Closed Hashing:
1. Separate chaining requires additional memory space for pointers.
2. With this method, a hash collision is resolved by probing, or searching through
alternative locations in the array until an empty bucket is found.
3. As all the elements are stored inside the table, a large memory space is
needed for open addressing.
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 2
3. • There are three different popular methods for open addressing techniques. These
methods are −
• Linear Probing
• Quadratic Probing
• Double Hashing
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 3
4. Linear Probing
• In this method, hash address of an identifier x is obtained
• If collision occurs, the identifier is place in the next empty slot after its home
bucket
• If slot hash(x) % S is full, then we try (hash(x) + 1) % S
• If (hash(x) + 1) % S is also full, then we try (hash(x) + 2) % S
• If (hash(x) + 2) % S is also full, then we try (hash(x) + 3) % S
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 4
7. DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 7
• Let us see the following example to get better idea. If we have some elements like
{15, 47, 23, 34, 85, 97, 65, 89, 70}. And our hash function is h(x) = x mod 7.
8. • Advantages :
1. Simple to implement.
2. Best case time complexity=O(1)
• Disadvantages :
1. If an element is not found at computed location. Searching goes in linear way.
2. Hash table may become Full.
3. Make clustering: many consecutive elements form groups.
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 8
9. #define MAX 10
int insert_lb(int key)
{
j=key % MAX;
for(i=0;i < MAX ; i++)
{
if(ht[j]== -1)
{
ht[j]=key;
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 9
return(j);
}
j=(j+1)%MAX;
}
return(-1);
}
Procedure to insert key in hash table
10. • Procedure to search key in hash table
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 10
int search_lb()
{
cout<<“Enter the key to be search”;
cin>>key;
j= key % MAX;
for(i=0;i<MAX;i++)
{
if(ht[j]==key)
return(j);
else
j=(j+1)%MAX;
}
return -1;
}
11. Linear Probing with Chaining
• In this method, another field get added into the table.
• In this field, the address of the colliding data can be stored with the first colliding
element in the chain table, without replacement.
• Records can be easily located.
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 11
13. From the example, you can see that the chain is maintained from the number who
demands for location 1.
First number 131 comes, we place it at index 1. Next comes 21, but collision occurs
so by linear probing we will place 21 at index 2, and chain is maintained by writing
2 in chain table at index 1.
Similarly next comes 61, by linear probing we can place 61 at index 5 and chain will
maintained at index 2.
Thus any element which gives hash key as 1 will be stored by linear probing at
empty location but a chain is maintained so that traversing the hash table will be
efficient.
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 13
14. • Insert following keys into hash table with linear probing with chaining without
replacement method. Use H(x)= x % 10 function
1. 0,1,4,7,64,89,11,33,55 Use H(x)= x % 10 function
2. 10,12,20,18,15 Use H(x)= x % 8 function
3. 11,32,41,54,33,1 Use H(x)= x % 10 function
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 14
16. • Disadvantages:
1. Main purpose of hashing is not achieved, because all records are not
mapped at correct position or mapped at wrong position/address.
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 16
17. DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 17
void insertwor(int b[][2])
{
int r,s,t,a;
printf("n Enter Data");
scanf("%d",&a);
s= a % MAX;
if(b[s][0]==-1)
b[s][0]=a;
else
{
while(1)
{
printf("nTrue Collision Occurs");
getch();
if(b[s][1]== -1)
{
t=s;
while(b[s][0]!=-1)
{
s=(s+1)%MAX;
if(s==t)
{
printf("Overflow");
break;
}
}
19. void displaywor(int b[][2])
{
int i,r,s,t,a;
printf("nINDEXtDATAtCHAIN");
for(i=0;i<max;i++)
{
if(b[i][0]!=-1)
{
printf("n%d",i);
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 19
printf("t%d",b[i][0]);
//if(b[i][1]!=-1)
printf("t%d",b[i][1]);
}
}
getch();
}
20. void searchwor(int b[][2])
{
int r,s,a;
printf("Enter Data Which U Want To Search");
scanf("%d",&a);
s=a%MAX;
while(1)
{
if(b[s][0]==a)
break;
s=b[s][1];
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 20
if(s==-1)
{
printf("Not Found");
break;
}
}//end of while
else
{
printf("nIndex Is %d:",s);
printf("nData Is %d:",b[s][0]);
printf("n Index Which Is Chained From It:%d",b[s][1]);
}
}
21. Linear Probing with Replacement
• In this method, if another identifier ‘Y’ is occupying the position of an identifier
‘X’, X replaces it and then ‘Y’ is relocated to a new position.
• e.g. 11,32,41,54,33
• First 3 will get placed at address 1,2,3,4. but when 33 need to be placed it
position is occupied by 41.
• Therefore 33 replaces 41 and 41 inserted in new empty bucket i.e. 5 and chain
from element 11 at position 1 is modified
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 21
23. Insert following data 12,1,4,3,7,8,10,2,5,14 using linear probing with chaining with
replacement. Calculate average cost or no. of comparisons
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 23
0
1
2
3
4
5
6
7
8
9
10 -1
1 -1
12 6
3 -1
4 9
5 -1
2 -1
7 -1
8 -1
14 -1
Avg. Cost= (1+1+1+1+1+1+1+2+1+2)/no. of buckets
=12/10
=1.2
24. • Pseudo-code to insert Data in Linear probing with replacement
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 24
25. • The load factor for an open addressing technique should be 0.5. For separate
chaining technique, the load factor is 1.
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 25