Professional Documents
Culture Documents
Information System
Information System
CC4002NA
Coursework 1
TABLE OF CONTENTS
TABLE OF FIGURES
1.3 Example
To sort 5 elements (5, 4, 8, 1, 2) in an array, we have to make 4
comparisons so that the largest element will bubble up in the top of the array.
1 Dibya
Shrestha
INFORMATION SYSTEM(CC4002NA)
First pass
5 4 8 1 2
Exchange
4 5 8 1 2
No Exchange
4 5 8 1 2 Exchange
4 5 1 8 2 Exchange
4 5 1 2 8
No Exchange
4 5 1 2 8 Exchange
4 1 5 2 8
Exchange
4 1 2 5 8
5 comes to 2nd last place of array
In fig:2 1st element’4’ and 2nd element ’5’ are compared and are not swapped since
‘4’ is smaller than ‘5’. 2nd element ‘5’ and 3rd element ‘1’ are compared and then
swapped since ‘5’ is greater than ‘1’. 3 rd element ’5’ and 4th element ‘2’ are
compared. They are swapped since ‘5’ is smaller than ‘2’.
Third pass
4 1 2 5 8
Exchange
1 4 2 5 8
3 Dibya
Shrestha
INFORMATION SYSTEM(CC4002NA)
STEP 2: sorted=false
STEP 4: num_swaps=0
STEP 5:i=1
STEP 7:If list[i-1] > list [i] then goto step 8 else goto step 9
list i = tmp
Num_swaps=num_swaps+1
STEP 9:i=i+1
4 Dibya
Shrestha
INFORMATION SYSTEM(CC4002NA)
2.2 Flowchart
Start
Input
list list
Sorted=false
Sorted= NO
false
YES
Output list
Num_swaps=0
i=1
End
NO
i =i + 1 i<
list.length
Y
YES
NO YES
NO list [i-1] > Num_swap
list[i] s=o
YES
list i = tmp
Num_swaps=num_swaps+1
Figure 4: flowchart
5 Dibya
Shrestha
INFORMATION SYSTEM(CC4002NA)
3.1 Dictionaries
In this data types, one-one relationship between keys and values are defined.
EG:
A [1] = ‘abc’
A [2] = ‘xyz’
{1:’abc’, 2:’xyz’}
A = {1:’abc’, 2:’xyz’}
Here 1, 2 are key and ‘abc’ and ‘xyz’ are its associated values. The whole elements
are covered in curly bracket.
3.2 List
In python, list are used in collection of heterogeneous data. We can recognize
list by ‘[‘and ‘ ] ‘brackets.
Eg:
A= [0, 1, 2, 5, 7]
6 Dibya
Shrestha
INFORMATION SYSTEM(CC4002NA)
B= [apple, 0, ram]
A= [0, 1, 2]
A= [0, 1, 2, 3, 4, 5]
Len (A) 6
A= [0, 1, 2]
Searching in a list
A= [0, 1, 2, 2, 3, 1]
A= [0, 1, 2, 3, 4]
A.remove [“2”]
A= [0, 1, 3, 4]
3.3 Tuples
Tuple in python is an immutable list. (Pilgrim, 2010)As long as you do not try
to change it, tuple acts as a list except that the elements are enclosed in
parentheses bracket instead of square brackets. Positive index count from the start
of the tuple while negative index counts from the end of tuple. (Pilgrim, 2010)
7 Dibya
Shrestha
INFORMATION SYSTEM(CC4002NA)
3.4 Sets
Data structure used to test for the membership for the processing of group of
names is called sets. Creating a set automatically removes any duplicate entries. It is
useful to find out what is common difference between two sets of items. (Pixel, 2010)
Eg:
A=set ([‘red’,’white’,’blue’,’black’])
P001 Iphone 6 c 30
Dictionary data types is most suitable for the above data table. Dictionaries
uses keys and values. “The name is technically referred to as a key and any
corresponding detail is referred to as the value. The dictionary itself is a mutable
data type so we can remove and add new key/values in a dictionary” (Pixel, 2010).
As dictionaries can support tuple, strings and integers, the above data types also
contain varieties of strings and integers. We can also mix data types and delete data
types in dictionaries. Choosing the dictionary data types makes the problem more
efficient and convenience. (Pixel, 2010)
8 Dibya
Shrestha
INFORMATION SYSTEM(CC4002NA)
4. REPORT
Today the world has gone through the drastic changes through the
technologies that is introduced day by day. Information system is the study of
computer hardware and software which helps in storing, collecting and processing of
data and information. Python is a high level language which is used to create
programs. In general python provides a biggest hand in developing software and
enhancing the technologies. This module has helped me to deal with the data
systems and its use in the coding and programming.
Before starting the module, I had not gone through vast of the topic but I had
gain some information about python with my brother. Choosing the IT subject means
to become a good programmers. I expected to be familiar to the basic terms of the
module, so that it would be easier for me to deal with the difficulties that arises while
solving problems. I took the module quite easily that time, so it is difficult and I face
many difficulties while solving problems. As the module ‘information system is the
vast topic which requires a lot of focus, hardwork and time, it was difficult to
accommodate with the new course. It is a hard subject and each students must
practice more so that they can get used to the module.
Coming from a biology field, it was hard for me to be familiar with the basic
terms and technologies of information system at the beginning. It is still hard but I am
trying my best by taking help of my fellow friends and the respective teachers.
Whoever had choose this subjects, they have the motive to be familiar with the
module. So for me too, I am now familiar with the topics and going through my
regular classes, I feel the importance of information system in the developing world
and what changes can information system can bring in this world. So far till now I am
happy that I had chose this subject as I am very much interested in the respective
field.
perfect in this field, we must focus and pay our full attention to the course to
overcome the obstacles. I believe that practice makes a man perfect and with that
quote in my mind I will accept whatever the future brings in my life. As I have already
taken the subject, I must not loose my confidence and focus hence to meet my
expectations from the module and thus achieve the success and the goal of my life.
10 Dibya
Shrestha
INFORMATION SYSTEM(CC4002NA)
5. REFERENCES
Lambert, K. A., 2009. Fundamentals of Python: From First Programs through Data
Structures. Boston: s.n.
Lambert, K. A., 2009. Fundamentals of Python: From First Programs through Data
Structures. illustrated ed. s.l.:Cengage Learning.
Pixel, G., 2010. Python 3 for Absolute Beginners. illustrated ed. s.l.:Apress.
Chun, W. (2001). Core Python programming. Upper Saddle River, NJ: Prentice Hall
PTR.
11 Dibya
Shrestha