Professional Documents
Culture Documents
2022-11-18 Ads With Java - Day 1
2022-11-18 Ads With Java - Day 1
and
Computational Thinking
“Problem solving is a skill that can be developed via
practice”
• A decision is to be made.
• Any decision is usually better than no decision at all.
• Assign responsibility to carry out the decision.
• If a team then who will do what and when.
• If alone, still decide when are you going to do it
• Set a schedule.
• Without schedule and deadline, its just a discussion.
• Decomposition
• Break down complex problems into smaller, simpler problems.
• Pattern recognition
• Make connections between similar problems and experience.
• Abstraction
• Identify important information while ignoring unrelated or irrelevant details.
• Algorithms
• Creates sequential rules to follow in order to solve a problem.
Algorithm
and
Data Structures
Algorithm
• A “finite sequence” of “well defined” computational steps that transforms
“input” into the “output”.
• No single data structure works well for all purposes, and so it is important to
know the strengths and limitations of several of them.
-
Send a document to a friend .
→ address .
/→
file six
physical
doe '
↳ which document
text file
↳
→
A document
type → doe file
↳ platform
→
linux
→ wind
document ?
to
on
which channel send
document to send
Soft copy A
internet .
→ Constraint by size .
via
↳ share
↳ storage .
Hard copy
↳ Fax
↳ postal service
→
space
Internet
iii.
>
7
Posted
Linear Data Structures
203
Vbt no 1 202 , ;
Array
,
0
int sum =
;
i
• Need for an array?
↳ need to sum sum + n°1 ;
when
=
we
sum -1202 ;
do same processing sum =
-
wit E ] nos = -
- -
;
=:O ;
wit sum
:
+ + i]
I < - r
;
too Ci = 0
;
sum=sum+nosEEf-
Properties of Array
• Data Structure that stores multiple elements, all of the same type.
• All elements of an array are stored sequentially in memory, one after another.
↓
newy.int#3--yg-Eg-Index1i--I
wit I] arr ;
Subscript .
am =
azo
Allocates memory
for 5 integers .
5;
asr IO] =
arr [ 13=10 ;
3 int
÷t¥É¥an
away .
nt
A
Base add sent
• Disadvantages 2 * size A
• Fixed size. Resizing of array is inefficient. value stored
• Insertion and deletion of elements, in middle of array is inefficient. his Gooey .
0 I 2 3 4 am [Count 3=55
FEI Count →
→
4×-2
•:É=
+ +
county
,
wit count = 0
;⇐ logical size of array .
↳ indicates how
elements are stored in
many
away .
Aorayo8 ☒③aw
new * ≥
ii.+ an =
☐
5
am to] =
;
an [D= 105
any [232202
array
#
Problem as
← 3
-233=29 is only
.
an size
Create a
larger array
53¥10
.
away
[ <3 ; + +
for ( int [ = o
;
② t.IE] = an Ei}
original array Def
③ get
created array
newly
#
to
.
③ am =
ty
Inseotimmiddle-N-aorayw.it uist [5≥
to
am new
I] =
,H
aw [03=5 ;
ONE23=20
;
AN [ 23=10;
arr
?
count =3
+¥ʰ
Make space
¥
between
5£10 .
É÷?÷÷É!:
g- =
an
count -2;
Ij + ☐
size
=
.
ANE't≥
10 and all
By shifting j;
± .
- -
↳ a. }
"""" "
oisht an -1532 element, ++ count
place to .
,
0 I 2 3 72
FEE
arr
art
count A
③
sight
=
all
shift
t - →
elements to
Insert by 2 place .
7. in
Shift
EÉImpmA→É
int count ,
Ent Insert Atpos ( wit I] art
① ,
int element);
A- logical wit pos ,
size d- away
New
/
.
hilt Pos) ;
⑧ wit Delete Element ( int I] ans
,
Ent count
,
I
New
logical
,1 size A array . ↑ list element)j
occurrence
Delete first
/ A "
element
"
from array ,
wit Count
Delete All Element ( List I] arr
,
It
,
⊕ t ,
int element ,
all
Delete "
d-
" element
occurrences
array
from
.