Friday, March 11, 2011

CS- Copyright notice:

Copyright is a set of exclusive rights granted to the author or creator of an original work, including the right to copy, distribute and adapt the work. Copyright does not protect ideas, only their expression. In most jurisdictions copyright arises upon fixation and does not need to be registered. Copyright owners have the exclusive statutory right to exercise control over copying and other exploitation of the works for a specific period of time, after which the work is said to enter the public domain. Uses covered under limitations and exceptions to copyright, such as fair use, do not require permission from the copyright owner. All other uses require permission. Copyright owners can license or permanently transfer or assign their exclusive rights to others.

Initially copyright law only applied to the copying of books. Over time other uses such as translations and derivative works were made subject to copyright. Copyright now covers a wide range of works, including maps, sheet music, dramatic works, paintings, photographs, sound recordings, motion pictures and computer programs.


A copyright notice, either as symbol or phrase, informs users of the underlying claim to copyright ownership in a published work.
Copyright law is different from country to country, and a copyright notice is required in about 20 countries for a work to be protected under copyright. Before 1989 all published works in the US had to contain a copyright notice, the © symbol followed by the publication date and copyright owner's name, to be protected by copyright. This is no longer the case and use of a copyright notice is now optional in the US, though they may still be used as a deterrent against infringement, or as a notice that the owner intends on holding their claim to copyright.

A copyright notice or copyright symbol is an identifier placed on copies of the work to inform the world of copyright ownership. While use of a copyright notice was once required as a condition of copyright protection, it is now optional. Use of the copyright notice is the responsibility of the copyright owner and does not require advance permission from, or registration with the Copyright Office.

Because prior law did contain such a requirement, however, the use of a copyright notice or copyright symbol is still relevant to the copyright status of older works.

Copyright notice was required under the 1976 Copyright Act. This requirement was eliminated when the United States adhered to the Berne Convention, effective March 1, 1989. Although works published without copyright notice before that date could have entered the public domain in the United States, the Uruguay Round Agreements Act (URAA) restores copyright in certain foreign works originally published without copyright notice.

How Is A Copyright Symbol Useful

Use of the copyright notice may be important because it informs the public that the work is protected by copyright, identifies the copyright owner, and shows the year of first publication. Furthermore, in the event that a work is infringed, if a proper notice of copyright appears on the published copy or copies to which a defendant in a copyright infringement suit had access, then no weight shall be given to such a defendant's defense based on innocent infringement. Innocent infringement occurs when the infringer did not realize that the work was protected. The use of the copyright notice is the responsibility of the copyright owner and does not require advance permission from, or registration with, the Copyright Office.

Correct Form For The Copyright Symbol

The notice for visually perceptible copies should contain all the following three elements:
  1. The copyright symbol © (the letter C in a circle), or the word "Copyright," or the abbreviation "Copr."
  2. The year of first publication of the work. In the case of compilations or derivative works incorporating previously published material, the year date of first publication of the compilation or derivative work is sufficient. The year date may be omitted where a pictorial, graphic, or sculptural work, with accompanying textual matter, if any, is reproduced in or on greeting cards, postcards, stationery, jewelry, dolls, toys, or any useful article.
  3. The name of the owner of copyright in the work, or an abbreviation by which the name can be recognized, or a generally known alternative designation of the owner.

Example: copyright © 2002 John Doe

The © or "C in a circle" notice or symbol is used only on visually perceptible copies.
refer : http://inventors.about.com/od/copyrights/a/CopyrightNotice.htm
          http://en.wikipedia.org/wiki/Copyright_notice


Sunday, March 6, 2011

DS-operations on queue.

Operations:
The main primitive operations of a queue are known as:
Add - adds a new node
Remove - removes a node
Additional primitives can be defined:
IsEmpty - reports whether the queueis empty
IsFull - reports whether the queue is full
Initialise - creates/initialises the queue
Destroy - deletes the contents of the queue (may be implemented by re-initialising
the queue)

Common operations from the C++ Standard Template Library include the following:
bool empty() - Returns True if the queue is empty, and False otherwise.
T& front() - Returns a reference to the value at the front of a non-empty queue. There is also a constant version of this function, const T& front().
void pop() - Removes the item at the front of a non-empty queue.
void push(const T& foo) - Inserts the argument foo at the back of the queue.
size_type size() - Returns the total number of elements in the queue.
 
 
Some other Operations on queue are :
1. enqueue - insert item at the back of queue 
2. dequeue - return (and virtually remove) the front item from queue 
3. init - intialize queue , reset all variables.

refer : http://en.wikipedia.org/wiki/Queue_%28data_structure%29
          http://harvestsoft.net/files/queue.pdf
          http://hamilton.bell.ac.uk/swdev2/notes/notes_13.pdf

Saturday, March 5, 2011

DS- multi linked list

Multi-Linked lists

A multiple linked list has several pointers in each node. They are used to traverse the nodes in different orders, for example one set of links ordered by date of birth and another ordered alphabetically by name.

A list can have two pointers without having a backward pointer. For instance, we may want to keep a set of data ordered on more than one "key". A key is a unique data item included in a record which distinguishes one record from all other records included in the list.  Suppose we want to be able to access customer accounts in order by account number (integer) and by customer name (string). We can in fact have one list that is ordered both ways. We need two pointer fields.  Each node of the list will have the form:

refer: http://frank.mtsu.edu/~csci217/manual/lab10/lab10.html#D

image006.jpg
 
Now, let's assume that we have a class called MultiListClass and that we wish to implement this list with a dummy header node.

 Here is an example list which implements the multi-linked list:

image007.jpg
Insertion and deletion require about twice the work since two sets of pointers must be adjusted: one for the name and one for the account number.  Essentially, you perform the same adjustments as in a singly linked list but you do it twice.

DS- doubly linked list (page 2)

Doubly-Linked Lists — linked lists containing integer values or pointers to data, with the ability to iterate over the list in both directions.

Each element in the list contains a piece of data, together with pointers which link to the previous and next elements in the list. Using these pointers it is possible to move through the list in both directions (unlike the Singly-Linked Lists which only allows movement through the list in the forward direction).

The data contained in each element can be either integer values, by using one of the Type Conversion Macros, or simply pointers to any type of data.

While adding or removing a node in a doubly-linked list requires changing more links than the same operations on a singly-linked list, the operations are simpler and potentially more efficient (for nodes other than first nodes) because there is no need to keep track of the the previous node during traversal or no need to traverse the list to find the previous node, so that its link can be modified.

refer : http://en.wikipedia.org/wiki/Doubly-linked_list
          http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html

DS- doubly linked list (page 1)

A doubly-linked list is a linked data structure that consists of a set of sequentially-linked records called nodes. Each node contains two fields, called links, that are references to the previous and to the next node in the sequence of nodes.


plsss...refer : http://richardbowles.tripod.com/cpp/linklist/doublist.htm


A doubly linked list is one where there are links from each node in both directions:





current
position





Data




Data




Data




Data


NULL
NULL




DS- link list v/s array (page 2 )

3)Memory allocation:
Most often, arrays are static. The drawback to this approach is that large arrays require large amounts of memory, which may go unused.
On the other hand, linked lists are usually dynamic. They can grow and shrink as needed at runtime. Due to this trait, linked lists are more appealing when the number of elements is unknown.

4) Accessing elements:
The elements within arrays are accessed by their indices. Thus, data access is easy and fast if you know which element to retrieve. If you don’t know the index of the element needed, but the elements are sorted based on some key value, you can perform highly efficient search algorithms to locate specific elements.

Linked lists are usually traversed element by element until a match is found. Because the memory for linked lists is not guaranteed to be contiguous, this list traversal is the only method for searching the list (without involving the use of other data structures as indices ). 


5) Making the decision:
If your data is best represented using a multidimensional structure, or the number of elements is known in advance and will remain consistent, an array is best. If your data is easily represented in one dimension, and the number of elements is unknown or is expected to change often throughout the operation of your program, a linked list is more efficient.

also refer :
http://geeksforgeeks.org/?p=10245
http://geekexplains.blogspot.com/2008/05/array-vs-linked-list-advantages-and.html

DS- link list v/s array ( page 1)

Arrays and linked lists are among the most common data structures, and each is applicable in different situations.

1) An array is an ordered arrangement of data elements that are accessed by their referencing indices.
A linked list is a group of items, each of which contains a pointer pointing to the next item.


2)Sizing:
Arrays can be one-dimensional or multidimensional, depending upon your requirements. For example, you could use a one-dimensional array to store the scores of all students in a class for one test. A multidimensional array would be better to store the scores of all students for all tests throughout the semester. Figure A provides an example of a one-dimensional array, and Figure B shows a multidimensional array.

Figure A
One-dimensional array


Figure B
Multidimensional array


In Figure B, the scores may be averaged by test (across), by student (down), or by class (entire array), while each unique score is maintained.

In contrast to arrays, linked lists are, by their very nature, one-dimensional. They can be singly linked lists, as shown in Figure C, where traversal of the list can be done in only one direction, or doubly linked lists, such as in Figure D, where each element points to both the previous element and the next element in the list.

Figure C
Singly linked list