Tuesday, February 25, 2014
Sunday, February 16, 2014
Chapter 8 Outline
8.1 What is Abstract Data Type?
·
Abstract data
type (ADT):
o ADT is a
container whose properties (data & operations) are specified independently
of any particular implementation.
o We know their properties and operations and we
understand which types of values they can contain, but we have no information
about their internal structure or implementation.
(u know what it Is, what it means, but don’t need to see the implementation of it [no need to know how]) Example:
(u know what it Is, what it means, but don’t need to see the implementation of it [no need to know how]) Example:
§ Gmail (object)
§ Sign In/Create account (Operations)
§ User no need to look at the details, just do it.
o The basic idea is that the implementation of these
operations is written ONCE in the program, and any other part of the program
that needs to perform an operation on the ADT can do so by calling the
appropriate function.
o The goal in design is to reduce complexity thru
abstraction.
o To put concept of ADT into context, we need to look at
how we view data.
§ 3 Perspectives of viewing data in computing: (How much level u want the user to see it)
w Application Level (user): The view of data w/thin a particular problem.
(Don’t have to look at anything else, just look at particular problem)
(Don’t have to look at anything else, just look at particular problem)
w Logical Level
(Abstract): Abstract view of the data values and the operations that manipulate
them.
(Object has behavior) **work w/ differ classes**
(Object has behavior) **work w/ differ classes**
w Implementation Level: The specific representation of the structure that holds the data
items and coding of the operations in a programming language.
(You see codes) **Fixing messy codes etc**
(You see codes) **Fixing messy codes etc**
§ These 3 views concerned with Data Structures
– the implementation of a composite data field in an abstract data type.
w It is the way of storing the data in a manner so that we can access
those data easily at later time.
(Stack, Queue, List, Tree)
(Stack, Queue, List, Tree)
§ The ADT are containers which data items are
stored and each exhibits specific behaviors these are Containers because
their sole purpose is to hold other objects.
w Containers – Objects whose role is to
hold and manipulate others.
(variable, data[], SUM)
(variable, data[], SUM)
o
Logical Implementations:
o
2 logical implementations of containers:
§ Array-Based Implementation – Objects in
the container are kept in an array.
§ Link-Based Implementation – Objects in
the container are not kept physically together, but each item tells you where
to go to get the next one in structure.
(Don’t have to put them together, not need to be together can jump and come back)
(Don’t have to put them together, not need to be together can jump and come back)
· 8.2 Stacks
o
Stack is an abstract composite structure in which accesses
are made at only one end.
§ LIFO – Last
In First Out eg: Carts in the Mall
§ Insert – Push
§ Delete – Pop
· 8.3 Queues
o
Queues are an abstract structure in which items are entered
at one and removed from the other end.
§ FIFO – First In First Out eg:
Drinks sell @7-11
§ Insert – Enqueue/Enq/Enter/Insert
§ Delete – Dequeue/Deque/Deq/Delete/Remove
· 8.4 Lists
o
List is like a container of items.
o
The items are:
§ Homogeneous, Linear, Have vary lengths
o
Logical operations be applied:
§ Add item
§ Remove item
§ Get next item
§ More items
o
Array
– Built-In Structure & List – Abstract Structure.
o
A list may be
visualized as a Link Structure, this is based on the concept of node
o
Node consist 2 pieces of info: User’s data & a
link/pointer that indicates where to find the next node.
§ Link Structure – An
implementation of a container where the items are stored together with
information on where the next item can be found.
(Stack and Queue)
(Stack and Queue)
o
If the list is an
unsorted list, the items will be printed in the order in which they are
inserted.
o
If the list is
sorted, the items will be printed in sorted order.
o Stacks, Queues and Lists are LINEAR in
nature (items are next to each other) only
one relationship is being modeled.
· 8.5 Trees
o
Hierarchical
structures, each node in the tree can have more than two children.
o
Binary Trees :
§ An abstract structure in which each node is capable of
having 2 successor nodes called children, and so on (tree its branching
structure)
§ Beginning of the tree is a unique starting node called
root.
w Binary Trees – An abstract
composite structure OR A linked container w/ a unique starting node called the root, in
which each node is capable of having two child nodes and in which a
unique path exists from the root to every other node.
w Root
– The unique starting node in a tree.
(1 is the root)

§
A tree node that
has no children is Leaf. (7,8,9,10 are
leaf nodes)
§
Every node has a
unique (single) parent.
(2 = left subtree & 3 = right subtree of 1)
(2 = left subtree & 3 = right subtree of 1)
§
Any node in the
tree can considered the root node of a subtree. (subtree whose root node 2 also
includes the node 4 & 7)
o
Binary Search
Tree :
§ It is like a sorted
list in that there is a semantic ordering in the nodes.
§ A binary tree (shape
property) that has the (semantic) property that characterizes the values in a
node of a tree:
w (bigger go right,
lesser go left)
o
Build Binary Tree :
Bigger go right, lesser go left
Build Binary Tree :
Bigger go right, lesser go left
o
Other
Operations
§ Binary search tree is an object with the
same functionality as a LIST.
· 8.6 Graphs
o
A graph is made up of sets of nodes
called vertices and sets of lines called edges (arcs) that
connect the nodes.
o
The vertices
(dots) in the graph represent objects; the edges (lines) describe relationships
among the vertices (dots).
§ Graph –
A data structure that consists of a set of nodes and a set of edges that relate
the nodes to each other.
§ Vertex
– A node in a graph
§ Edge (arc)
– A pair of vertices representing a connection between two nodes in a graph.
o
Undirected
graph – A graph in which the
edges have no direction. (可來回)
§
![]() |
Two vertices that are connected by one edge – Adjacent Vertices
o
Directed
graph (digraph) – A graph in
which each edge is directed from one vertex to another (or the same) vertex.
§ Path – A sequence of vertices that connects
two nodes in a graph.
o
LISTS, STACKS, QUEUES, TREES –
All just holding containers.
§ Stacks return the item that has been in the stack the least amount of
time.
§ Queue returns the item that has been in the queue the longest amount of
time.
§ List & Trees return the info that is requested.
§
Graph has algorithm defined upon
it that actually solve classic problems.
o Graph Algorithms
§ Depth-First Search – Given a starting vertex and
an ending vertex, we can develop an algorithm that finds a path from startVertex
to endVertex.
w
It is
called Depth First search because we start at a given vertex and go to the
deepest branch and explore as far down one path before taking alternative
choices earlier branches.
§ Breadth-First Search
§ Single-Source Shortest-Path
Search
· 8.7 Subprograms
o
How we pass info back and forth btw
algorithms and sub-algorithms.
o
We call them subprograms rather than sub-algorithms.
o
Subprograms are available as part of
high-level language.
o Parameter Passing
o A parameter list is a list of the identifiers or values with which
the subprograms is to work.
§ Parameter List – A mechanism for communicating between
two parts of a program.
§ Parameters – The identifiers listed in parentheses beside
the subprogram name; sometimes called formal parameters.
§ Arguments – The identifiers listed in parentheses on
the subprogram call; sometimes called actual parameters.
o Value and Reference Parameters
o
2 ways of passing parameters:
§ Value Parameter – A parameter that expects a copy of its
argument to be passed by the calling unit (put on msg board).
(The calling unit gives a copy of the argument to subprogram)
(The calling unit gives a copy of the argument to subprogram)
§ Reference Parameter – A parameter
that expects the address of its argument to be passed by the calling unit (put
on msg board).
(The calling unit gives the address of the argument to subprogram)
(The calling unit gives the address of the argument to subprogram)
Tuesday, February 04, 2014
Ethical Issue: Open-Source Softwares
Thoughtful Questions:
1) There are several common examples of open-source software that many people use in their everyday lives. Can you name any?
- Linux : Operating System
- Google Chrome OS : Lightweight operating system based around the web browser.
- Android smart-phone operating system.
These are all familiar names that we ever heard. They are pretty common.
2) Do you believe that the quality of an open-source software product is likely to be higher or lower than the quality of software produced by a large corporation? How do you think technical support for open-source software compares to that for proprietary software?
-I believed that, the quality of an open-source software product is likely to be lower than than the quality of software produced by a large corporation. Because, the reason why the "original" product is being sell out on the market with some expensive price (software such Microsoft Office) it might cost something thousands; is because that, programmer actually spent a lot of time writing the codes and making this product up. And it is not just one person, its a large professional corporation that made it together. And because it is professional and it is good enough to sell it with price, that software and its quality must be good enough and worth to buy. So by looking at this we can imagine the quality of the open-source software product, it wouldn't be too good. First of all, people could edit it and make changes with the coding from the original, but how do you know that the person that is giving you this free software that he or she just made changes is just a good programmer or not? And since they know that it is not as good as the original that's made by a large corporation, they then feel ok to give out people for free.
3) Daniel Bricklin, biography appears in Chapter 12, did not patent (or copyright) his software, believing that software should not be proprietary. As a result, he lost a great deal of money in the form of possible royalties. Do you consider his actions to be visionary or naive?
-I think is naive, because he didn't copyright his software and didn't think of the consequences of believing that the software should not be proprietary which is losing a great deal of money. He could have at least have an idea of believing that the software should not be proprietary BUT it is ok for others to have only IF they copyright the software to the owner.
4) The Free Software Foundation is a tax-exempt charity that raises funds for work on the GNU Project. GNU software is free. Go to the Web and read about its philosophy. Compare GNU products with those of manufacturers such as Microsoft and Sun.
-Obviously it is different already when you see the name. GNU is a free software foundation that raises funds for work on the GNU project but Microsoft software needed to be paid in order to have the software and they are not made for funds like GNU software.
5) If you were to continue with computing and become a programmer, which side of the argument would you take: Should software be copy-righted or should it be free?
- I would take soft wear be copy-righted. Because the reason why a software is sell it with price is because it worth that price. Imagine an engineer sitting in font of the computer, typing codes again and again, input as many possible values as possible (basically testing) and they ended up giving out the codings for nothing. In the person who actually "write the codes"'s view, I would just say no, they need to copyright my softwares and my work that I've done for long time. But in a general people's point of view. Sometimes when a software is not free, I wouldn't want to go actually buy them, I will just download it. But in this question is talking about "become a programmer" so my answer is "it should be copy-right".
Monday, February 03, 2014
Blog Post: My Winter Holiday
This is a Prezi about my Winter Holiday! It contains the things that I'd done during the holiday. It was nothing much, mostly I just stayed home or go to my aunty's house. But of course, I did something fun at home such as watching dramas, animes with myself or with my family together! My sister and I always watch movies, chit chat, or eat the whole night; night time is our world! we watched many movies at night together. And so we sleep in the morning till early in the afternoon mostly (which is not good). Anyways, other than having fun at night and spend time at aunty's house, my family and I also went for a 3 days trip at HuaHin for welcoming the Year of 2014 ! (for more information,have a look at my Prezi below).After I've done my Prezi about my new year, I realized that, Time flies so quickly!
Tuesday, January 21, 2014
Blog Post: Startups steal the show 2014
And in this article I'll be mentioning about the new and cool products that came up 2014 in the International Consumer Electronics Show. The first product is a small simple and cute looking device that has a cube shape components. We can play around with it by joining more cubes together since there's a small circle magnets attach to the cubes that enables many cubes join together and become one. It included a modular robotic concept called Moss. We can build different styles of robots however we want.
Next, this product is call the "Kolibree" smart toothbrush. This toothbrush can inform the person who is brushing their teeth about whether they are brushing their teeth in a correct way or not, in this, we are able to brush our teeth more clean.
Next, this product is also a kind of product that suits a lot of people which is call the "Mother". The reason why its called "Mother" is because its function or its job is just like a mother. It has a accelerator-based, motion-tracking fitness concept in this wireless device with Bluetooth. It can sense the motions for whatever such as reminding you to take medicine, tell you to drink more water etc.
Next, this product is call Panano. It is like a small ball, about a size of your palm. It is covered with lenses all over that you can throw in the air and it can capture a 72-megapixel, 360-degree, great quality image. It's so cool that the cost of it is a little bit expensive.
Main Concept:
As year goes by, there are more and more new interesting products coming up in the market. Just like what it's been mentioned in this article: The robot that you can create however you want it to be by attaching them together at the joint that has magnets; The little cute Teddy bear that has a main function which is to measure blood pressure, heart rate, etc. This grabs kid's attention and eventually, parents can check out kids' body health by using this bear instead of going to the hospital since this bear could connect to a smartphone and tell everything about the person who's holding the bear's palm. There are more new products mentioned in this article, basically it is all new and convenient and products that includes "smart" ideas.
Advantage & Disadvantage:
The good thing about these is that, they are really convenient and they are very smart. With these products, we can live our life easily. But the bad thing is that, these "smart" products are never going to be cheap. Because since its so smart, it must have inserted with a lot of coding and expensive exponents combined together to create it, of course the price will be a bit higher. And since its a bit higher, people won't be thinking to actually buy them.
Question:
What will happen if the world doesn't have these kind of convenient products anymore? Will robot take over us in the future?
Citation:
"CES 2014: Startups steal the show." CNET. 20 Jan. 2014 <http://ces.cnet.com/8301-35301_1-57617051/ces-2014-startups-steal-the-show/>.
Thursday, November 14, 2013
Testing
Basically, when they talk about testing, it is talking about executing programs and see the result whether it is how we want or not. And testing is not only running the program once but, we need to do many times and follow several steps. First one is to make a test plan.
A test plan is a doc that tell us how many times we need to run over the program in order to test through out the whole program.
Next is the two approaches, which is Code Coverage and Data Coverage. Code coverage, which is an approach that make sure we execute all the statements in the "code", not missing any one. For the Data coverage now is not testing the codes but its about the possible "inputs values"; basically try/input possible values.
Then is the Test Plan Implementation. This involves running program (according to the test plan), execute the result and if the result is not as what the user wanted to be, the user must be able to look at the plan and see the mistakes that they'd made to let the program appeared error, that's why the plan is important when testing.
A test plan is a doc that tell us how many times we need to run over the program in order to test through out the whole program.
Next is the two approaches, which is Code Coverage and Data Coverage. Code coverage, which is an approach that make sure we execute all the statements in the "code", not missing any one. For the Data coverage now is not testing the codes but its about the possible "inputs values"; basically try/input possible values.
Then is the Test Plan Implementation. This involves running program (according to the test plan), execute the result and if the result is not as what the user wanted to be, the user must be able to look at the plan and see the mistakes that they'd made to let the program appeared error, that's why the plan is important when testing.
In my opinion, "testing the program" is very important also, especially with the plans that you made because, if you test the program with the plans you made and run each one by one, if error occurs, you can always go back and check your mistakes since you have the notes. In addition, if you tested the program with input-ing many possible values, you'll get to know more about the program whether it is what YOU want or not (not working/errors occurred).
Thursday, October 31, 2013
Blog Post: The popular Apps in school
Nowadays, everything become very efficient and convenient! Even in school. People use to go school with bunch of textbooks, notebooks, and pencils etc. Now people would just bring an iPad, basically tablet or electronic device but how does that help teachers and students while teaching and learning? Well there are many apps that are educational and are perfect for school (teachers and students). Of course, Apps are making everything easier. Instead of writing a report by hand, we could simply just go Google drive and make presentation online and just share with the teacher's email, it is that easy and quick. Sometimes teachers wouldn't have enough time to finish their teachings and it might be the reason that, they had to prepared a lot before the teaching day by making up speeches, notes and probably a "real-life" example of something. So on the day of teaching he/she would have to present to the class, and just by writing down the notes on the board takes about 5 minutes. But if the teacher used apps such as Google presentation, all they have to do on the day of teaching is just talking, students can get the notes from teacher by sharing the documents to students so that the student can focus on listening to the teacher instead of being busy taking down the notes. And there are actually 10 apps that are really common and is a great tool for teachers to use which are: Google Apps, Twitter, Skype, YouTube, EverNote, Dropbox, ClassJojo, Edmodo, WordPress *blogging software*, and Socrative. In here I will be talking about the ones that I've seen it almost with all the teachers and think it is very useful and awesome. ;)
1. Google Apps!
This is the most famous apps of all! not only on education but also search tools from Google is large and convenient. The apps in Google Apps that teachers would use the most would probably be Google documents. In Google documents, teachers can share students his or her notes just by clicking "share" and enter the student's email address. Isn't that fast? If there's a group work, teachers always tell students to use Google document so that we can do the presentation or work together at one time, and even though we don't meet each other during the weekends, we could still go online and do the work together! That's why it is so famous for teacher's tool ! In this point, student won't have any excuse like "my paper is gone", "my partner is not around" etc.
2. Twitter!
This app are also available for sharing things! Just like my teacher Mr.Pete, he always shared students articles about the latest interesting things about technology so that even though we don't know how to search or what to search about the latest technology, we can just go there and find articles that he shared with us!!
3. YouTube!
4. Dropbox!
Dropbox is a really convenient app for sharing "files". And it is really cool that we can share big files to each other. Before if teacher want to send those big files to students, they might need USB or Email (but email have limitations). For drop box, students and teachers and share big files "online"! if you don't want to download the app. If you downloaded you can see the files keep on updating on the desktop, isn't that just so convenient? We don't even have to sign in etc... we can just open the folder called "dropbox" on our desktop and the files would be updated automatically when there's new stuff being added in.
Major Concetps:
There are apps that are really useful when it comes to education! They all became teacher's favorite apps when it comes to teaching. Apps like YouTube, Google etc are really convenient in good the way of students 'and teachers' teachers and learning. Apps are mostly "online", and online are teacher's "favorite". It is not just convenient, it also saves a lot and I mean A LOT of time!
Advantage and Disadvantages:
The advantage of apps that teacher uses with students is that it really saves a lot of time. Before if we want to do research we might have to go library and get books, but now internet has "everything". If teachers saw something that is helpful to students, they would share with students too! and when I say sharing, it is simply just send them the link or share them the link by one click. Quick, and easy.
Since it is online, when teachers want to share us something, we can always go back and check the things they shared with us, we don't need to go ask them again.
The disadvantage would be that, if there's no "INTERNET"... or the internet shuts down somehow, students wouldn't be able to access to teacher's blog and if we tell teacher that we couldn't access to internet, they would be like : "sorry but is your problem". probably for some students, the might lie to teacher and take advantage of " cannot access to internet ". But for some people that really cannot access to internet will then have a big problem. -__-"
Questions:
I wonder what will happen to people now without these technology/apps/internet access...will people go back to the time when we still do homework by writing etc...?
Citation:
"The 10 Most Popular Teacher Tools Being Used This Year." Edudemic. N.p., n.d. Web. 01 Nov. 2013.
Subscribe to:
Posts (Atom)
