The document discusses arrays and their representation in memory. It contains 3 main points:
1) It introduces linear arrays and how they are represented in memory with sequential and contiguous locations. It also discusses multidimensional arrays.
2) It provides algorithms for common linear array operations like traversing, inserting, deleting and searching using binary search. It explains how each algorithm works through examples.
3) It discusses how 2D arrays are represented in memory and visualized, using an example of storing student exam marks in a 2D array.
Describes basic understanding of priority queues, their applications, methods, implementation with sorted/unsorted list, sorting applications with insertion sort and selection sort with their running times.
a. Concept and Definition✓
b. Inserting and Deleting nodes ✓
c. Linked implementation of a stack (PUSH/POP) ✓
d. Linked implementation of a queue (Insert/Remove) ✓
e. Circular List
• Stack as a circular list (PUSH/POP) ✓
• Queue as a circular list (Insert/Remove) ✓
f. Doubly Linked List (Insert/Remove) ✓
For more course related material:
https://github.com/ashim888/dataStructureAndAlgorithm/
Personal blog
www.ashimlamichhane.com.np
Describes basic understanding of priority queues, their applications, methods, implementation with sorted/unsorted list, sorting applications with insertion sort and selection sort with their running times.
a. Concept and Definition✓
b. Inserting and Deleting nodes ✓
c. Linked implementation of a stack (PUSH/POP) ✓
d. Linked implementation of a queue (Insert/Remove) ✓
e. Circular List
• Stack as a circular list (PUSH/POP) ✓
• Queue as a circular list (Insert/Remove) ✓
f. Doubly Linked List (Insert/Remove) ✓
For more course related material:
https://github.com/ashim888/dataStructureAndAlgorithm/
Personal blog
www.ashimlamichhane.com.np
Linked Lists: Introduction Linked lists
Representation of linked list
operations on linked list
Comparison of Linked Lists with Arrays and Dynamic Arrays
Types of Linked Lists and operations-Circular Single Linked List, Double Linked List, Circular Double Linked List
Queue is an abstract data structure, somewhat similar to Stacks. Unlike stacks, a queue is open at both its ends. One end is always used to insert data (enqueue) and the other is used to remove data (dequeue). Queue follows First-In-First-Out methodology, i.e., the data item stored first will be accessed first.
Queue is a collection whose elements are added at one end and removed from the other end
What is a Queue
Conceptual View of a Queue
Uses of Queues in Computing
Operations on a Queue
Implementation of a Queue
Applications
Downloadable Resources
Linked Lists: Introduction Linked lists
Representation of linked list
operations on linked list
Comparison of Linked Lists with Arrays and Dynamic Arrays
Types of Linked Lists and operations-Circular Single Linked List, Double Linked List, Circular Double Linked List
Queue is an abstract data structure, somewhat similar to Stacks. Unlike stacks, a queue is open at both its ends. One end is always used to insert data (enqueue) and the other is used to remove data (dequeue). Queue follows First-In-First-Out methodology, i.e., the data item stored first will be accessed first.
Queue is a collection whose elements are added at one end and removed from the other end
What is a Queue
Conceptual View of a Queue
Uses of Queues in Computing
Operations on a Queue
Implementation of a Queue
Applications
Downloadable Resources
It is a presentation on some Searching and Sorting Techniques for Computer Science.
It consists of the following techniques:
Sequential Search
Binary Search
Selection Sort
Bubble Sort
Insertion Sort
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
2. 2
OBJECTIVE
• Introduces:
Linear array and it’s representation in main
memory.
Operations of a linear array
Multidimensional array
2-dimensional array representation in a
memory
3. 3
CONTENTS
Introductions
Linear Array
Linear Array Representations in Memory
Traversing, Insert, and Delete Algorithms
Binary Search Algorithm
Multidimensional Array
Array
Representations in Memory
Inconsistency Matrix Algorithms
4. 4
Introduction
• Data Structure can be classified as:
linear
non-linear
• Linear (elements arranged in sequential in memory
location) i.e. array & linear link-list
• Non-linear such as a tree and graph.
• Operations:
Traversing, Searching, Inserting, Deleting,
Sorting, Merging
• Array is used to store a fix size for data and a link-list
the data can be varies in size.
5. 5
2.1 Introduction
• Advantages of an Array:
a) Very simple
b) Economy – if full use of memory
c) Random accessed at the same time
• Disadvantage: wasting memory if not
fully used
6. 6
Linear Array
• Homogeneous data:
a) Elements are represented through indexes.
b) Elements are saved in sequential in memory locations.
• Number of elements, N –> length or size of an array.
If:
UB : upper bound ( the largest index)
LB : lower bound (the smallest index)
Then: N = UB – LB + 1
Length = N = UB when LB = 1
7. 7
Linear Array
• All elements in A are written symbolically as, 1 .. n is the
subscript.
A1, A2, A3, .... , An
• i.e., FORTRAN, PL/1 and BASIC A(1), A(2), ..., A(N)
Java A[0], A[1], ..., A[N-1] , subscript starts from 0
LB = 0, UB = N–1
8. 8
Representation of Array in a Memory
• The process to determine the address in a memory:
a) First address – base address.
b) Relative address to base address through index function.
Example: char X[100];
Let char uses 1 location storage.
If the base address is 1200 then the next element is in 1201.
Index Function is written as:
Loc (X[i]) = Loc(X[0]) + i , i is subscript and LB = 0
1200 1201 1202 1203
X[0] X[1] X[2]
9. 9
Traversing Algorithm
Traversing operation means visit every element once.
e.g. to print, etc.
Example algorithm:
1. [Assign counter]
K=LB // LB = 0
2. Repeat step 2.1 and 2.2 while K <= UB // If LB = 0
2.1 [visit element]
do PROCESS on LA[K]
2.2 [add counter]
K=K+1
3. end repeat step 2
4. exit
10. 10
Insertion Algorithm
Insert item at the back is easy if there is a space. Insert
item in the middle requires the movement of all elements
to the right as in Figure 1.
0 1 2 3 4 k MAX_LIST-1
1 2 3 4 5 k+1 MAX_LIST
12 3 44 19 100 … 5 10 18 ? … ?k+1
size
Array indexes New item
ADT list positions
items
Figure 1: Shifting items for insertion at position 3
11. 11
Insertion Algorithm
Example algorithm:
INSERT(LA, N, K, ITEM)
//LA is a linear array with N element
//K is integer positive where K < N and LB = 0
//Insert an element, ITEM in index K
1. [Assign counter]
J = N – 1; // LB = 0
2. Repeat step 2.1 and 2.2 while J >= K
2.1 [shift to the right all elements from J]
LA[J+1] = LA[J]
2.2 [decrement counter] J = J – 1
3. [Stop repeat step 2]
4. [Insert element] LA[K] = ITEM
5. [Reset N] N = N + 1
6. Exit
12. 12
Deletion Algorithm
Delete item.
(a)
0 1 2 3 4 k-1 k MAX_LIST-1
1 2 3 4 5 k k+1 MAX_LIST
12 3 44 100 … 5 10 18 ? … ?k
size
Array indexes
Delete 19
ADT list positions
items
Figure 2: Deletion causes a gap
13. 13
Deletion Algorithm
(b)
0 1 2 3 k-1 MAX_LIST-1
1 2 3 4 k MAX_LIST
12 3 44 100 … 5 10 18 ? … ?k
size
Array indexes
ADT list positions
items
Figure 3: Fill gap by shifting
14. 14
Deletion Algorithm
Example algorithm:
DELETE(LA, N, K, ITEM)
1. ITEM = LA[K]
2. Repeat for I = K to N–2 // If LB = 0
2.1 [Shift element ke J + 1, forward]
LA[I] = LA[I+1]
3. [end of loop]
4. [Reset N in LA]
N = N – 1
5. Exit
15. 15
Binary Search Algorithm
• Binary search algorithm is efficient if the array is sorted.
• A binary search is used whenever the list starts to become
large.
• Consider to use binary searches whenever the list contains
more than 16 elements.
• The binary search starts by testing the data in the element at
the middle of the array to determine if the target is in the first
or second half of the list.
• If it is in the first half, we do not need to check the second
half. If it is in the second half, we do not need to test the first
half. In other words we eliminate half the list from further
consideration. We repeat this process until we find the target
or determine that it is not in the list.
16. 16
Binary Search Algorithm
• To find the middle of the list, we need three variables, one to
identify the beginning of the list, one to identify the middle
of the list, and one to identify the end of the list.
• We analyze two cases here: the target is in the list (target
found) and the target is not in the list (target not found).
17. 17
Binary Search Algorithm
• Target found case: Assume we want to find 22 in a sorted
list as follows:
• The three indexes are first, mid and last. Given first as 0 and
last as 11, mid is calculated as follows:
mid = (first + last) / 2
mid = (0 + 11) / 2 = 11 / 2 = 5
4 7 8 10 14 21 22 36 62 77 81 91
a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9] a[10] a[11]
18. 18
Binary Search Algorithm
• At index location 5, the target is greater than the list value (22 > 21).
Therefore, eliminate the array locations 0 through 5 (mid is automatically
eliminated). To narrow our search, we assign mid + 1 to first and repeat
the search.
4 7 8 10 14 21 22 36 62 77 81 91
a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9] a[10] a[11]
0 5 11
first mid last
Target: 22Target: 22
22 > 21
19. 19
Binary Search Algorithm
• The next loop calculates mid with the new value for first and
determines that the midpoint is now 8 as follows:
mid = (6 + 11) / 2 = 17 / 2 = 8
4 7 8 10 14 21 22 36 62 77 81 91
a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9] a[10] a[11]
6 8 11
first mid last
Target: 22Target: 22
22 < 62
20. 20
Binary Search Algorithm
• When we test the target to the value at mid a second time, we discover that the
target is less than the list value (22 < 62). This time we adjust the end of the list
by setting last to mid – 1 and recalculate mid. This step effectively eliminates
elements 8 through 11 from consideration. We have now arrived at index location
6, whose value matches our target. This stops the search.
4 7 8 10 14 21 22 36 62 77 81 91
a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9] a[10] a[11]
6 6 7
first mid last
Target: 22Target: 22
22 equals 228 6 7
function terminates
first mid last
21. 21
Binary Search Algorithm
• Target not found case: This is done by testing for first and last crossing:
that is, we are done when first becomes greater than last. Two conditions
terminate the binary search algorithm when (a) the target is found or (b)
first becomes larger than last. Assume we want to find 11 in our binary
search array.
4 7 8 10 14 21 22 36 62 77 81 91
a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9] a[10] a[11]
0 5 11
first mid last Target: 11Target: 11
11 < 21
22. 22
Binary Search Algorithm
• The loop continues to narrow the range as we saw in the
successful search until we are examining the data at index
locations 3 and 4.
4 7 8 10 14 21 22 36 62 77 81 91
a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9] a[10] a[11]
0 2 4
first mid last
Target: 11Target: 11
11 > 8
23. 23
Binary Search Algorithm
• These settings of first and last set the mid index to 3 as follows:
mid = (3 + 4) / 2 = 7 / 2 = 3
4 7 8 10 14 21 22 36 62 77 81 91
a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9] a[10] a[11]
3 3 4
first mid last Target: 11Target: 11
11 > 10
24. 24
Binary Search Algorithm
• The test at index 3indicates that the target is greater than the list value, so we set first to mid
+ 1, or 4. We now test the data at location 4 and discover that 11 < 14. The mid is as
calculated as follows:
• At this point, we have discovered that the target should be between two adjacent values; in
other words, it is not in the list. We see this algorithmically because last is set to mid – 1,
which makes first greater than last, the signal that the value we are looking for is not in the
list.
4 7 8 10 14 21 22 36 62 77 81 91
a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9] a[10] a[11]
4 4 4
first mid last
Target: 11Target: 11
11 < 14 4 4 3
first mid last
Function terminates
25. 25
Binary Search Algorithm
• Example algorithm:
DATA – sorted array
ITEM – Info
LB – lower bound
UB – upper bound
ST – start Location
MID – middle Location
LAST – last Location
26. 26
Binary Search Algorithm
1. [Define variables]
ST = LB, LAST= UB;
MID = (ST+LAST)/2;
2. Repeat 3 and 4 DO ST <= LAST & DATA[MID] != ITEM
3. If ITEM < DATA[MID] then
LAST = MID-1
If not
ST = MID+1
4. Set MID = INT((ST + LAST)/2)
[LAST repeat to 2]
5. If DATA[MID] = ITEM then
LOK = MID
If not,
LOK = NULL
6. Stop
28. 28
2-D ARRAY
• A 2-D array, A with m X n elements.
• In math application it is called matrix.
• In business application – table.
• Example:
Assume 25 students had taken 4 tests.
The marks are stored in 25 X 4 array locations:
U0 U1 U2 U3
Stud 0 88 78 66 89
Stud 1 60 70 88 90
Stud 2 62 45 78 88
.. .. .. .. ..
.. .. .. .. ..
Stud 24 78 88 98 67
n
m
29. 29
2-D ARRAY
• Multidimensional array declaration in Java:-
int [][] StudentMarks = new int [25][4];
StudentMarks[0][0] = 88;
StudentMarks[0][1] = 78;…..
OR
int [][] StudentMarks = {{88, 78, 66, 89},
{60, 70, 88, 90},…}
30. 30
2-D ARRAY
• In Java the 2-D array is visualized as follows:
…
[0]
[1]
[2]
[3]
[4]
[5]
[6]
[24]
StudentMarks
88 78 66 89
60 70 88 90
62 45 78 88
[0] [1] [2] [3]
31. 31
Exercises
• Find where the indicated elements of an
array a are stored, if the base address
of a is 200* and LB = 0
a) double a[10]; a[3]?
b) int a[26]; a[2]?
*(assume that int(s) are stored in 4 bytes
and double(s) in 8 bytes).