You are on page 1of 8

LIFFEE Access Method

Muhammad Irfan
Liffee Access method
 To remove the drawback of dope vector method for
accessing array elements we use the Liffee method
which is more faster than dope vector method.
 This method consist of an access table which consist
of pointers.
 This method is used for accessing the elements of
two dimensional array.
 The array in the memory will be mapped either row
wise or column wise.
 Each pointer in the access table will be responsible
either for a single row (in case of row mapping) or
for single column (in case of column mapping).
Diagrammatic representation

5 6 20
A= 34 10 15

7 51 09

In case of row mapping the


Liffee method is as follow
(1,1) (1,2) (1,3) (2,1) (2,2) (2,3) (3,1) (3,2) (3,3)

5 6 20 34 10 15 7 51 9
Pointer Rows T-element

1 3

2 3

3 3
Con’t

5 6 20
A= 34 10 15

7 51 09

In case of Column mapping the


Liffee method is as follow
(1,1) (2,1) (3,1) (1,2) (2,2) (3,2) (1,3) (2,3) (3,3)

5 34 7 6 10 51 20 15 9
Pointer Col T-element

1 3

2 3

3 3
Liffee Method for Strings
 The previous two methods deal with the
numeric data type.
 If the data type of two dimensional array is
character (string) then the structure of the
access table changes.
 The first column of access table will show the
string number, 2nd column will show the start
address of string and the 3rd column of access
table will show the total number of elements.
Con’t
Access table for strings
Naveed
A= Ali String. No Start address T-elements

khan 1 1 6
2 7 3
jawad 3 10 4
4 14 5

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

N a v e e d A l i k h a n j a w a d
Traversing Array
algorithm: Traversing
This algorithm is used for accessing the elements of an array A. Let Ub
is the upper bound and Lb is the lower bound, let N and i are two
counter variables.
Step-1:[initialization of counter variables]
i=Lb, N= Ub
Step-2:[starting loop]
repeat step 3 and 4 while (i<=N)
Step-3:[Print the values of array]
display (A[i])
Step-4:[Increment counter]
i=i+1
Step-5:[finish]
exit
Searching largest value in Array
Algorithm: Finding largest value
Let i is the loop variable and N contains total number of memory locations. Let A is the
name of array and “largest” is an integer variable.
Step-1:[initialization]
i Lb
Step-2:[Assignement]
largest=A[0]
Step-3:[start loop]
repeat step 4 and 5 while (i<=N)
Step-4:[condition]
if (A[i] > largest) then
largest= A[i]
Step-5:[increment loop counter]
i=i+1
Step-6:[print largest]
display (“largest value is =”, largest)
Step-7:[finish]
exit

You might also like