0% found this document useful (0 votes)
63 views

Array Class Techer Notes

1) The document describes an algorithm for allocating elements in a multi-dimensional array using linear addressing. 2) Elements are stored in memory sequentially based on their index values. Addresses for each element are calculated using a base address plus an offset based on the element's position. 3) Examples are given to demonstrate how to calculate the memory address for specific elements in a 3D array using this linear addressing scheme.

Uploaded by

Harshit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Array Class Techer Notes

1) The document describes an algorithm for allocating elements in a multi-dimensional array using linear addressing. 2) Elements are stored in memory sequentially based on their index values. Addresses for each element are calculated using a base address plus an offset based on the element's position. 3) Examples are given to demonstrate how to calculate the memory address for specific elements in a 3D array using this linear addressing scheme.

Uploaded by

Harshit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

AMOLLH

AMe An Amcuy a calletom d simlas da


ems. The daka tkm a chd ten Hauasdyan
Ond
Ahane Lommm hom. The indiwdus dah Cm
Ccens n wd by H ndeY numkon.

e lasnhon dodabye Aowhame LSize] 3


Fn int
Ls]',
in nun1o3,
nihelig int os): Llo, IS,20,2s,30s
Spnku ta e ahayhome[sia]- us valuar
Peta o
i n t numT¢) = ilo, IS, 20,a, 30,3s};
Cnsatr

arasu n tnie - iee the Vralue an e t e


G-vn index.
Seanh
Sent

)ngahien uen ht Aet h


adeint an emayt
Lais in JAS d mard,. Aiy asehon hu Siy na
AMcn Amtnrodby a S i t o ou. n n h'on eN
yy mm Uny 1pcicu aklocattd loy nouy
smadat h d dddXhonal lsmant.
Lerom Lon he done hen at Hu nd on ata
poen, Jmenh on cu hhe me can be donLOAi
Howennh m Con limant cuany cott Lo caion,
tmands m o oved downwonds lo heuw Aocohonu ko
attwmsde bu
l
Dlo
S
3

adaHon a nd
enrom ot ahien Posit e
2luHen-E 2lehon sens Rmov am slemnt om
shn is slimnts. Aeu
a r Amoy i dtenaaol by fachn l.
C e posi Hon. o m Amay. blehen c the n d Conn a
dona vny AaAI Howeren ,h dltk On llment hom amyH
Cheso ahom H e lemunh ce Fo ho O d upvond
Annd il p u ocahey yaaid by h amovtd
emant.
Ouhom aend RaLhon sia Gn foto

8 nlitr
atec l 2
2

Uhgin Muie
he pnoaM oLEmbinins he ho
Aoys i s a Sing Mo.
may AnoA h f soTd, tmt Cam an

ugin hnue kd e aloeytG


Unbin hem ne to md t. e. we Con pu
han he t m e n j e Se tnel
hsCU
hhscuh inind Hnd AMey
tnk Hnd ma.
Amo
Amoy
AMu A
35
Prey& 3

Mngty
Cenblw
tha he consinnd
mSeb nds The boa appna is fu Cem
aluo
AGnN
Pone u a mont Bbakt d on hat duu whi

5 |
ney s718 |lo 2isa 30
Arrlicoh cw - dinsional Amay

Th cns uLeel h tmpumand- othn dao shut


Aueh Sels, 4 l , map .
Umihiov e - p
Auy
0 Tnlo noule da, d umhen d slumuni 4 MCM
9 AmA awStthc muam memeny cullo cahd al
nmpilahion hime , the mumnu Coun n e e mdud
AmioRd
Amo lument Shmd n au

Avcaho, he mCon h'oy Cimd dlLHion nahay


C Hme Cwumi.

De ckainR
doht y ye akscincme houo- siyJ Lceliumn -sie)

l Cuai
numaI3
tal a
d 3 0w 3 CAu
int
nunm3] 3) 1,2,3,4,S,7 8,11 =

n halyi doatuyu aMaynqme [hou sig)[celun-0

num[)o] num)U) hu-]5)|


hu2)Tu) numJ) num-p]s}| &
A ho- Qmionel Ame Cen
impluminttd tn dro
( Po Mao 0ndor- hhy
how
dementh Cone shoud Aow

C ajo Qo Ao1 ow
Ca2
Cro 2 21 Lo 3

Coo a o Qu n 2o 222
3
O Column -ae de n Hhiy leimantr au shend ldu
by C mn.
Aoo o |20
o o 22
umn) C mn 2
nn 3
oo CD
a C 2
aLo a a22
Ceumn Ctimn 2
Cumn 3
3-1 Ma A 3-D Amo a
Ck
cdau

mvnumtohen b AMa in MlmeMY


Th
T addnen a panhudas dten n o Amy
3en by lation
ddnn mant
atk) BrW> k CcdMA 1-e addiey
Rc staleMadang

S Lach sltnantd an
Amcuy
KlnAAr dlsnst
a addey h ihs+ d t
bu m
200o nd
SIn liment Ml be)

aTk) = + w
xs
aTs) 2 000
o00 +20
addon aMay emt
Caleloh en Lon whu mmay,
mnt a shuol t n Lonhguas
te. addes hast iemns
aho o by Khouny e ax addann
ne , aAMos Hh emensh Can be coludetd.

nl&y da aleyt ATK) = BA + w(K-toueshond ) |


tn-1D Amay
A-aM
Fa AT5)-271,67,85C, 88 - indoxmatwih
we wan h a l u
Ady
BA oo o w = - Bag Addnnu
Cal udat the addu ATy)
w -i on lamnt
n mny
A =BA + w k -loun bound ) looG looc Uloa8
oc
Jooo4+(4 -o)
oo0 +8 z loo8 Af3) A)
PEo) A) A)
eoo ad
he hst alamnd Ama
he Bask Addwnd add hSi
occoui 4 b n he neymny H a
a ch eluma

W #4
sed BA-= 2o d0
bound)
B A w (K-loun
Zee n ama
ATK= (Lowe bound
o00+4(5 - o) y homZn )
A Cs1 st
+20

Sooo + 4(6-| )
OR
Len
bound s | AC
=

o 0 0 + 45)
o00+

adds in2-D Amay


Collah May ej erday
A teud (n Row -

Cnl
Womnb
in(-L, )+i-Lu)y
d
l t hC) 0) =BA
meje,Addha

Mae Cd, WiC-L,)m(i-LL)}|

ColLumn utA[TJI4)
=
3A +
Adday d
in à D DM CLuy
lenena
Adno

alimeat a[ Di)= B+W (ni-L,) T6 -L\


Ali en t
BaseBase addnu
Ym n
h no Ceumn

Li hoven Bound e w
o wen Bomed Llstmo
L
2 Colun- ao enle
Adheos dlmatoi ) -3+w-L) +m(-L,
a addlny

alulali
6 AMma lo x50), BAsE AppeEss 2e0 S in momOy-4.
aM C s Senc Ro ma od s Lelumn mA
ende
gel.CaD ow
ATt) B+W(n(t-LI) -+ U)
Ateio)= 2000 t 4 (5a(lo-6) t ((0-0))
20 + 4(5oo to)
t4CSTd)

Ch.) lelumn -mayon enl


) tw(C-&1)+ m(i-L2))
AT1oJo) 2o00 -t 4 C(l0-o) + 2o(Lo -0))

o0 +AC2 ) 2o o0 t &Yo
2840
AO ud-wa in ymanmey, hhst tlement
A De aem is theud a locakon &0. And the memeny tatery
4x3D) i nch lsyun amc i s 4 amoy
Jocohonu.
o m caon oW i') )=&+WhC- L) +G-L ))
3 ) = 80+ 4 (4(3-0) +-0>)
o 4 (12 +2 )
&o+4 (19)
+5

136
Spoe hai mataix wAtch mos h a w ha valnn Zuo.
Tostu'ty TyMu Loue tangudo, matiiy
Tayangulan Mabny uqy ionulan apu
hralagennd Mataiy
Louh Thalor M»Aty n whia l he mnt abt maliy
diuand ane Zeo

1 To Juvy

iamsle Makir. tn u h all h lA mant halow h matn


&lagonad ane Zuo.

To
To Muwy A ew alaumm in m i1o cny
wd
lavmnal
1,2,3,1, S, 6,T, 8,1,lo
CAan -i uySI,2,4,7,3,5,86,9, 1oy

alg. hma
t matn dlayonal, mgeokter
RA mouln dtaponal
uponal betow h

Fo
3 4
K
3o o 8

o o o8?
54,1SJR,9,3,), 4,2L,5,19,8.7}
(
, 3, 4,S, C, 78,9,|oj
Cuwh -m a
( S,3,8,1,2
4,5,1, 9,2,3, 4,),2,
3,2, 1,0,5, 7,9,8,R10 1 , 2 , 1 , 2,93
5,7, 4,S ,S ,41,3,
C D o n s le a j H 5, O5
23,C1 , 4 , 9 , 1 o
tnlndik shlto. h>
'nudu (umlo, kA
vot' maind)
o/
in n, i, aftol
2
3 5
Sconf (" %d", n)

n (ieo Li-n-i, lt+) 8S


s nflhdK»", 8 ai))
)2
pninl hovsiy AMoy),
CS
inF C"% d}n", al10)

Algonrhhm fen NA CLLhaversal


TEP [iwTILIZATION) SET L = LB
TEp2 e ptet Sp» 3 o 4 ul T <=URB
Srcp 3 Agpy hoass s h
STEP 4 scT
°T=I+|
EN OF LooP)
STEP5
ExIT
TNSETIen
an ant a nd
geni Hhvm
S t penbound qnboumd tI
2Su AT bound) - Val
3 Exi
b) nu an enan in
middh hAmcuy
Alaonuth
LNSERTA,N ,POS,AL)
A Cney pos
posiHan a waih Jamn
N No mant VA L Vaus
had hay h inse
S u t I =N-1
a
apiat Shpa 3 amed 4 whi IX= Pos
Se L+1) A[T) -

SuI 1-I
End p )
S sut N N t)
6 S A[Pos) YAL

4s 23 34 1 s2o
ATI) A AFs)
incot A, G,3,
loo)
4s 23 3412 5 o
MO) AL AJ2) K3) AT ATS)

4 23 34 12 2 3 A
51
42334 12 52
3

4 3 34) loo 12]s


O 2 3

i n d e (shdio.hs
+ inddude {omio.h
Ydnce in )

int i, n, hum , pos, Lio)


PainhE n Entz the nunken SuvMond
LonF( 9.ed", 9n),
PinF (" £nt e 2Aavan),
Sn Cia0, n , (t*)

LLanf ("%d",paL))
3
in (nn i alumnt onnUmhn o ke Andaykd");

SComF().d",fnum),
at whih huibu i

Undykd")
Scans 9.d", }pos),
Sen(i=h -1 , i>= pos ,i--)
a[i)aTi]
C pos) : hum,

a4insenkon"),
Pi'nhs (" Xn Ame

pinss ("%d", ali]))

qth)

DELETION
Dehb at nd
hm
S
Uppubound enaound -

b) oilhon une om he Middle c AM (at agin l


AlGenlm
0ETEA, N, Pos)
N No zamani
Posihonhom uhd he l m t hanb hr delbtd
NITIALIZATIOn) s~ T Pos
a Ppat Shp 3 and 4 wh T<= N-1
Se I T+|
nd Lomp
S. S N N
G

fen4DEL& Te (A, C 2)

4334|
2
12
3
S
S
4s]12 2 3

as 2 12 5 ]
O

4F1R5 2 3 4
hnam stdio .K>
tn ua{
incude < Com to.hy
YO matnc)

t n t C,h,pos,a lio) in e un")


numbu
£ut d dlemun
PAtFC
Canf"%d", sn),
Sen (io's iin', it+)

SCom (" %d", jaTN S eunt d')


iste keddela
3 The posihon hom
whuw he

SconF ( J%",pos),
Sen-pos, ia=n -,C++)
aItaltt1)

PinF(" Anna a ddion" )


Sen tizo, tad'î+)
i s " 7.d ", ali)),

You might also like