Monthly Archives: February 2014

Circuit and packet switching

Circuit switching is when the data picks a pre-determined route down the network to the destination. The advantages are that it all arrives at the same time and down a secure network that is only being used by you. However it is more expensive as you are using a designated server and if that server is broke you lose all the information.

A packet switch is when the data is broken up into little packets that all contain the destination ip and then each packet chooses its own route to the destination. The advantages is that if part of the server is broken it can find a different path and it is cheap as it is not using a designated server however that means it is not as safe. Also it has to wait till all the packets are back to combine and give out the information so can be slow.

Protocols- HTTP which stands for Hypertext Transfer Protocol.

Within computer science, a communications protocol is a system of digital rules for data exchange within or between computers. When data is exchanged through a computer network, the rules system is called a network protocol

Advertisements

Leave a comment

Filed under Uncategorized

parameters and arguments

when you select the field that you want to include in a query then run it, every record in the database which contains the selected field would be returned. A parameter is the value that is used by the select the record 

1.  def greeting (person):

           print “hello”,person

on the first line we have added a variable called person in the brackets and so can now use the variable whenever during the procedure.

Leave a comment

Filed under Uncategorized

Binary search

A technique for quickly locating an item in a sequential list. The desired key is compared to the data in the middle of a sequential index or in the middle of a sequential file. The half that contains the data is then compared in the middle, and so on, either until the key is located or a small enough group is isolated to be sequentially searched.

Image

Leave a comment

Filed under Uncategorized

linear search

Linear search, also known as sequential search, is a process that checks every element in the list sequentially until the desired element is found. The computational complexity for linear search is O(n), making it generally much less efficient than binary search (O(log n)). But when list items can be arranged in order from greatest to least and the probabilities appear as geometric distribution (f (x)=(1-p) x-1p, x=1,2), then linear search can have the potential to be notably faster than binary search.

An example is
bool jw_search ( int *list, int size, int key, int*& rec ) { // Basic sequential search bool found = false; int i; for ( i = 0; i < size; i++ ) { if ( key == list[i] ) break; } if ( i < size ) { found = true; rec = &list[i]; } return found; }

Leave a comment

Filed under Uncategorized

Sorting information

Merging information-quite often data held in two separate files need to be merged to form a single file. the simplest way to do this is to is to copy file A into a new file C then append the data from file B to it.

link to images-http://www.teach-ict.com/as_as_computing/ocr/H447/F453/3_3_5/data_structures/miniweb_search/pg5.htm

insertion sort-this is a simple comparison sort where the sorted list is built up one item at a time. it has many advantages as it is very easy to code, performs well with small lists and is very memory effectives as it only needs one extra storage unit.

link to images-http://www.teach-ict.com/as_as_computing/ocr/H447/F453/3_3_5/data_structures/miniweb_search/pg7.htm

quicksort-developed n the 60s as an extremely fast way of sorting medium to large list. it relies heavily on recursion as one problem is that the stack can grow so much that a stack overflows.

link to images-http://www.teach-ict.com/as_as_computing/ocr/H447/F453/3_3_5/data_structures/miniweb_search/pg9.htm

 

Leave a comment

Filed under Uncategorized