Tuesday, July 8, 2014

File Organization

FILE ORGANIZATION:

It refers to the way of arranging the records in a file which can be accessed in a faster way.
The criteria considered in choosing a file organization are:
1) Fast access to single record or collection of related records.
2) Easy record adding/ update/ removal without disrupting.
3) Storage efficiency
4) Redundancy as a warranty against data corruption.

The files are generally viewed as
• Logical File organization: The groups of fields which are combined to form logical
record, which can perform different operations on the file.
• Physical file organization: The data which is stored in the form of records can be
placed in any storage devices, main memory, secondary memory etc.


Types of File Organization:
I) Sequential Access File Organization
II) Direct Access File Organization
III) Index Sequential Access File Organization


I) Sequential Access File Organization:

1) All records are stored in a sequential order.
2) That is, the records are arranged in the ascending or descending order of a key field.
3) Eg: a) In a student information system, the file would contain roll number, name, division, marks
obtained in the examination.
b) In a payroll application, the records are stored with employee number as a
key field.
4) To locate a particular record in such file organization, we have to start searching
from the beginning of the file until it is found in the file.
5) It is time consuming process.
6) Normally created and maintained on magnetic tapes. Eg: Audio Cassettes.
7) There is no need for any storage space identification

Advantages:
1) Simple to understand
2) Easier to organize, maintain
3) Economical
4) Error in files remain localized

Disadvantages:
1) Entire file has to be processed
2) Transactions must be sorted in a particular sequence before processing
3) Time consuming searching
4) High data redundancy
5) Random enquiries are not possible to handle


II) Direct Access File Organization (Random Access or relative file organization).:

1) Also known as Random Access or relative file organization.
2) Records are stored in Direct Access Storage Device(DASD). Such as magnetic disk(Hard disks).
3) For direct access, the file is viewed as numbered sequence of blocks or records.
4) These blocks or records are taken as key for accessing the desired information randomly.
5) It allows arbitrary (random) blocks to be read or written.
6) It is useful for immediate access to large amount of information. They are often used in accessing
large databases.
7) This technique is called as hashing

Advantages:
1) Immediate Access of the desired records.
2) No sorting of the records is required.
3) Faster updating of several files.
4) Helps in online transaction processing system like online reservation systems.

Disadvantages:
1) Data may be accidentally erased or over-written unless special precautions are taken
2) Backup facility is needed
3) Expensive- hard disks are needed to store the records, it is expensive
4) Less efficient as compared to sequential file organization in the use of storage space
5) Only one key is used
6) Cannot be accessed sequentially


III) Index Sequential access file organization(ISAM)

1) This file organization is a synthesis of the above two file organizations.
2) It combines the positive features of both the sequential and direct access file organizations.
3) Here records are stored randomly on a direct access device such as magnetic disk by a primary key.
Hence, we can access data either sequentially or randomly using the index. The index is stored in a
file and read into memory when the file is opened.
4) It may have multiple keys. These keys can be alphanumeric
5) The key upon which the data records are ordered is called the primary key.
6) Other keys are called alternate keys

Advantages:
1) Multilpe keys – are also alphanumeric in nature
2) Both sequential and random access is possible
3) Accessing of records is fast, if the index table is properly organized

Disadvantages:

1) More storage space is needed because of the presence of Index
2) Less efficient in the use of storage space as compared to other file organizations
3) It requires special software, i.e expensive.

Call by value and Call by refrence

Explain call by value and call by reference with example.

Call by value-
When a function call is given, a relationship is established between actual and formal parameters.
A temporary storage is created for formal parameters to store the data(actual parameters) received
as input from calling function. This process of data transfer from actual parameter to formal
parameters is known as call by value.

Ex: void main()
{ int a=20,b=30,x;
int f1(int,int);
-----
x=f1(a,b);
-----
getch( );
}
int f1(int p, int q)
{
p=p+p;
q=q+q;
return(p+q);
}

Call by reference-
When a function is called, the address of variables are passed on to the
called function. The parameters receiving the address should be pointer variables. This
concept of sending the address of data from calling function to pointer variables in the
called function is known as call by reference.

Ex: viod main()
{
int a=10,b=15,c=20;
------
X=f1(&a,&b,&c);
------
getch();
}
int f1(int *p1, int  *p2, int  *p3)
{
*p1=*p1+10;
*p2=*p2+5;
}

More on Networking


Network services
File Services-All the data files of an organisation are stored in one place and can be
shared by many users. Files can be organized and updated systematically.
Print Services- When Printers available on the Network , multiple users can print to
the same printer. The network printers are usually faster and more capable. They
may have accessories such as envelope readers or multiple paper trays
Database Services-Multiple users can have access to the database at the same time.
The Database software ensures integrity of data and provides multiple access.
Message Services-The services include Electronic mail, voice mail, remote
access,document transfers across the internet.
Application services- several software applications that are developed using
network architecture. The applications can be made available to multiple users. Any
up-gradation made to these applications is also instantly available to the users.

Advantages of Computer Network
Speed:- The files can be transferred from one Computer to another instantly.
Cost:- Application software(Network version) can be installed on one Computer and
accessed by other Computers on the Network. This makes maintenance and
upgrading of software easy.
Security:- The information on the computer can bemade available only through
password.Further some information can be made available only for reading and
not copying.
Resource sharing:- Expensive peripheral devices can be shared by many users in a
network.
Easy access:- Users can access information from any computer that is available on
the network. They need go to a specific Computer which may be located in a
different building or different location to retrieve information from their account.

Sunday, July 6, 2014

Status codes

Staus codes:-

Informational
Code :-100
Phrase :- Continue
Description:-The initial part of the request has been received , and the client may continue with the request.

Code :- 101
Phrase :- Switching
Description :- The server is complying with a client request to switch protocols defined in the upgrade header.


Success
Code :- 200
Phrase :- OK
Description :- The request is successful

Code :-201
Phrase :- Created
Description :- A new URL is created .

Code :- 202
Phrase :- Accepted
Description :- The request is accepted , but it is not immediately acted upon


Code :- 204
Phrase :-  No content
Description :-There is no content in the body


Redirection


Code :- 301
Phrase :- Moved permanently
Description :- The requested URL is no longer used by the server.


Code :- 302
Phrase :- Move temporarily
Description :- The requested URL has moved temporarily.


Code :- 304
Phrase :- Not modified
Description :-The document has not been modified.


Client Error

Code :- 400
Phrase :- Bad request
Description :- There is a syntax error in the request.


Code :- 401
Phrase :- Unauthorized
Description :- The request lacks proper authorization.


Code :- 403
Phrase :- Forbidden
Description :- Service is denied .


Code :- 404
Phrase :- Not found
Description :- The document is not found.


Code :- 405
Phrase :- Method not allowed
Description :- The method is not supported in this URL.


Code :-  406
Phrase :- Not acceptable
Description :- The format requested is not acceptable.
 



Server Error

Code :-500
Phrase :- Internal Server error
Description :- There is error , such as a crash , at the server site.

Code :- 501
Phrase :- Not implemented
Description :- The action requested cannot be performed.

Code :- 503
Phrase :-  Service unavailable
Description :-The service is temporarily unavailable ,but may be requested in the future.
 


DNS in the Internet

DNS is  a protocol that can be used in different platforms.

In the Internet the Domain Name Space is divided into three different sections :

1) Generic domains

2) Country domains and

3) The Inverse domains

1) Generic domains:-
The generic domains define registered hosts to their generic behavior.

Generic domain labels are as follow:-

aero :-   Airlines and aerospace companies

biz    :-   Businesses or firms

com   :-   Commercial organizations

coop   :-  Cooperative business organizations

 edu    :-  Educational institutions

gov      :-  Government institutions

info     :-   Information service provides

int       :-  International organizations

mil      :-  Military groups

museum :- Museums  and other non profit organizations

name    :-  Personal names (individuals)

net      :- Network support  centers

org     :-  Non profit organizations

pro     :-  Professional individual organizations


2) Country domains:-
The country domains section uses two - character country abbreviations.
Example :-
us  :-  United States

in  :-   India

uk  :- United Kingdom

Second labels can be organizational ,or they can be more specific , national designations.
The United States ,for example , uses state abbreviations as a subdivisions of us example ca.us


3) Inverse domains:-
The inverse domain is used to map an address to a name .the convention of reading domain labels from bottom to top ,an IP address such as 132.34.45.121 is read as 121.45.34.132.





Wednesday, July 2, 2014

Multiple choice questions on Computer

Multiple choice questions on Computer



1) Infrared signals can be used for short range communication in a closed area using _______propagation.
A) ground
B) sky
C) line of sight
D) space



2)A bridge has access to address in the same network.
A) Physical
B) Network
C) Data Link
D) Application



3) The minimum frame length for 10 Mbps Ethernet is _______ bytes and maximum is ______bytes
A) 64 & 128
B) 128 & 1518
C) 1518 & 3036
D) 64 & 1518



4) The bit rate of a signal is 3000 bps .If each signal unit carries 6 bits ,the baud rate of the signal is_____.
A) 500 baud/sec
B) 1000 baud/sec
C) 3000 baud/sec
D) 18000 baud/sec



5) KPA in CMM stands for
A) Key Process Area
B) Key Product Area
C) Key Principal Area
D) Key Performance Area


6) In function point analysis the number of complexity adjustment factors is
A) 10
B) 12
C) 14
D) 20



7) A shift reduce parser suffers from
A) shift reduce conflict only
B) reduce reduce conflict only
C) both shift reduce conflict and reduce reduce conflict
D) shift handle and reduce handle conflicts



8) How many different truth tables of the compound propositions are there that involve the propositions p & q?
A) 2
B) 4
C) 8
D) 16


9) While (87) printf("computer");
A) print "computer" 87  times
B) print "computer" 0 times
C) print "computer" 1 times
D) print "computer" infinite times



10) Manager salary details are hidden from the employee . This is called
A) Conceptual level data hiding
B) Physical level data hiding
C) External level data hiding
D) Local level data hiding


11)Which of the following is the correct value returned to the operating system upon the successful completion of a program?
A) 0
B) 1
C) -1
D) Program do not return value


12)A clustering index is created when ______.
A) primary key is declared and ordered
B) no key ordered
C) foreign key ordered
D) there is no key and no order



13)A friend function can be used to
A) avoid arguments between classes
B) allow access to classes whose source code is unavailable
C) allow one class to access an unrelated class
D) None of the above



Click here for more questions

Friday, June 27, 2014

Solve General Knowledge Questions

Solve General Knowledge Questions




1) Which of the following is social network?

A) amazon.com
B) eBay.com
C) gmail.com
D) twitter

Ans:-D) twitter



2) Internal communication within institutions is done through

A) LAN
B) WAN
C) EBB
D) MMS

Ans:- A)LAN




3) Virtual reality provides
A) Sharp pictures
B) Individual audio
C) Participatory experience
D) Preview of new films

Ans:- C) Participatory experience




4) The first virtual university of India came up in
A) Andhra Pradesh
B) Maharashtra
C) Uttar Pradesh
D) Tamil Naidu

Ans:- D) Tamil Naidu




5) The initial efforts for internet based communication was for
A) Commercial communication
B) Military purpose
C) Personal interaction
D) Political campaigns

Ans:- B) Military purpose




6) The post-industrial society is designated as
A) Information society
B) Technology society
C) Mediated society
D) Non - agricultural society

Ans:- A) Information society




7) The major source of the pollutant gas,carbon mono-oxide (CO) ,in urban areas is
A) Thermal power sector
B) Transport sector
C) Industrial sector
D) domestic sector

 Ans:- B) Transport sector




8) In a fuel cell driven vehicle ,the energy is obtained from the combustion of
A) Methane
B) Hydrogen
C) LPG
D) CNG

Ans:- B) Hydrogen




9) In certain code TEACHER is written as VGCEJGT.  The code of CHILDREN will be
A) EKNJFTGP
B) EJKNFTGP
C) KNJFGTP
D) None of these

Ans:-  B) EJKNFTGP




10) The principles of fundamental research are used in
A) action research
B) applied research
C) philosophical research
D) historical research

Ans:- B) applied research




11) Anil is twice as old as Sunita .Three years ago ,he was three times as old as Sunita .The present age of Anil is
A) 6 years
B) 8 years
C) 12 years
D) 16 years

Ans:- C) 12 years




12) The mean marks obtained by a class of 40 students is 65 .The mean marks of half of the students is found to be 45 .The mean marks of the remaining students is
A) 85
B) 60
C) 70
D) 65

Ans:- A) 85



13) Who among the following is the de facto executive head of the planning Commission?
A) Chairman
B) Deputy Chairman
C) Minister if State for Planning
D) Member Secretary

Ans: :- B) Deputy Chairman



14) Education as a subject of legislation figures in the
A) Union List
B) State List
C) Concurrent List
D) Residuary Powers

Ans: -C) Concurrent List



Algorithm of sorting

An algorithm to sort an elements using Insertion Sort.

Algorithm for Insertion sort:-
Step 1 : START
Step 2 : Input N
Step 3 : For I←0 to N -1
Read A [ I ]
( end of I for loop )
Step 4 : For I←1 to N -1 Do
Step 5 : J = I
Step 6 : While ( J > = 1 ) and ( A[ J ] < A [ J -1 ] )
Step 7 : TEMP = A [ J ]
Step 8 : A [ J ] = A [ J - 1 ]
Step 9 : A[ J - 1 ] = TEMP
Step 10 : J = J - 1
[ end of While loop ]
[ end of step I For loop ]
Step 11 : For I←0 to N -1
Step 12: Print A [ I ]
Step 13 : Stop

Consider the elements
A[0 ]    20
A[1]    16
A[2]    4
A [3]    3

Pass 1:
A[1],A[0]>16,20,4,3
Pass 2:
A[2],A[1]> 16,4,20,3
A[1],A[0]>4,16,20,3
Pass 3:
A[3],A[2]> 4,16,3,20
A[2],A[1]>4,3,16,20
A[1],A[0]> 3,4 16,20
Sorted order is 3,4,16,20

Algorithm for bubble sort:-

Step 1 : START
Step 2 : Input N
Step 3 : For I←0 to N -1
Step 4 : Read ( A [ I ] )
( end of for loop )
Step 5 : For I←1 to N -1
Step 6 : For J←0 to N –I - 1
Step 7 : If (A[ J ] > A [ J +1] )
Temp←A [ J ]
A [ J ]←A [ J + 1 ]
A [ J +1 ]←Temp
[ end of if ]
[ end of J loop ]
[ end of I loop ]
Step 8 : For J←0 to N -1
Print A [ J ]
Step 9 : Stop

Consider the following elements: 50 , 20, 10 , 05
Pass 1:- 50    20    10    05
             20    50    10     05
             20    10     50    05
             20     10    05    50
Pass 2:-  20    10    05    50
               10    20    05    50
               10    05    20     50
Pass 3:- 10    05    20    50
             05    10     20    50

Sorted order is 5, 10, 20 , 50

 Algorithm for selection sort:-

Step 1 : START
Step 2 : Input N
Step 3 : For I←0 to N -1
Step 4 : Read A [ I ]
Step 5 : For I←0 to N -2
Step 6 : S←A [ I]
Step 7 : Pos←I
Step 8 : For J←I + 1 to N -1
Step 9 : If ( A[ J] < S )
Step 10 : S←A [ J ]
Step 11 : Pos←J
[ end of if ]
[ end of J For loop ]
Step 12 : A [ Pos ]←a[ I ]
Step 14 : A[ I ]←S
[end of I For loop ]
Step 15: For I = 0 to N – 1
Step 16: Print A[ I ]
Step 17: Stop

An algorithm to find the maximum in an array:-

Step 1 : [Assume 1st element is the largest ]large = A [ 0 ]
Step 2 : POS = 0
Step 3 : [ Find the largest element in the array and its position]For I = 1 to N – 1 Do
Step 4 : If ( A [ I ] > large ) Then
Step 5 : large = A [ I ]
Step 6 : POS = 1
[ End if ]
[ End of step 3 for loop ]
Step 7: [ Print the largest and its position]Print “ Largest = “ , large , “ position = “ , pos
Step 8: Exit


An algorithm to find the minimum in an array:-

Step 1 : [Assume 1st element is the smallest]small = A [ 0 ]
Step 2 : POS = 0
Step 3 : [ Find the smallest element in the array and its position]
For I = 1 to N – 1 Do
Step 4 : If ( A [ I ] < small ) Then
Step 5 : small = A [ I ]
Step 6 : POS = 1
[ End if ]
[ End of step 3 for loop ]
Step 7: [ Print the smallest and its position]
Print “ smallest = “ , small , “ position = “ , pos
Step 8: Exit


Linear search method with an algorithm:-

Step 1 : START
Step 2 : input N
Step 3 : for I←0 to N -1
Read A [ I ]
Step 4 : Loc = -1
Step 5 : For I = 0 to N- 1 do
Step 6 : If ( ele = A[I]) Then
Step 7: Loc = I
Step 8 : Goto step 9
[ end if ]
[ end for ]
Step 9 : If ( Loc > = 0 ) then
Step 10: Print “ ele Found in location “ , Loc
Step 11: else
Step 12: Print “ ele not found ”

Step 13 Stop






 Algorithm for Binary Search:


Step 1: Low = 0
Step 2 : High = N – 1
Step 3 : Loc = -1
Step 4 : While ( Low < = High ) Do
Step 5 : M = ( Low + High ) / 2
Step 6 : If (ele = A[M ] ) Then
Step 7: Loc = M goto Step 12
[ end if ]
Step 8 : If (ele < A [M ] ) Then
 Step 9: High←M – 1
Step 10 : Else
Step 11 : Low←M + 1
[ end of if ]
[ end of While loop ]
Step 12 : if ( Loc > = 0 ) Then
Step 13: Print “ element , found , search successful ” , Loc
Step 14: else
Step 15 : Print “ Item not found , search Unsuccessful ”
[ end if ]
Step 16 : Stop

Thursday, June 26, 2014

Memristor

Memristor Definition:-
According to the original 1971 definition, the memristor was the fourth fundamental circuit element, forming a non-linear relationship between electric charge and magnetic flux linkage.

What is memristor?
Ans.As its name implies, the memristor can "remember" how much current has passed through it. And by alternating the amount of current that passes through it, a memristor can also become a one-element circuit component with unique properties. Most notably, it can save its electronic state even when the current is turned off, making it a great candidate to replace today's flash memory. 



The memristor definition is based solely on the fundamental circuit variables of current and voltage and their time-integrals, just like the resistor, capacitor and inductor. Unlike those three elements however, which are allowed in linear time-invariant or LTI system theory, memristors of interest have a dynamic function with memory and may be described as some function of net charge. There is no such thing as a standard memristor. Instead, each device implements a particular function, wherein the integral of voltage determines the integral of current, and vice versa. A linear time-invariant memristor, with a constant value for M, is simply a conventional resistor.Like other two-terminal components, real-world devices are never purely memristors ("ideal memristor"), but also exhibit some amount of capacitance, resistance and inductance.

Memristors will theoretically be cheaper and far faster than flash memory, and allow far greater memory densities. They could also replace RAM chips as we know them, so that, after you turn off your computer, it will remember exactly what it was doing when you turn it back on, and return to work instantly. This lowering of cost and consolidating of components may lead to affordable, solid-state computers that fit in your pocket and run many times faster than today's PCs. 

Symbol:-


Someday the memristor could spawn a whole new type of computer, thanks to its ability to remember a range of electrical states rather than the simplistic "on" and "off" states that today's digital processors recognize. By working with a dynamic range of data states in an analog mode, memristor-based computers could be capable of far more complex tasks than just shuttling ones and zeroes around. 

Beyond that, memristors will likely replace both DRAM and hard disks.


Conceptual symmetry between the resistor, capacitor, inductor, and the memristor..

The technology, called memristor, could allow computers to make decisions by understanding past patterns of data it has collected, similar to human brains collecting and understanding a series of events.

For example, a memristor circuit could be capable of telling a microwave the heating time for different food types based on the information it has collected over time, said Stanley Williams, senior fellow at HP.

A memristor circuit requires lower voltage and less time to turn on than competitive memory like DRAM and flash.



Featured posts

Ethiopian culture calendar language

Ethiopian culture, calendar, language  The Ethiopian language, specifically Amharic , uses a script called Ge'ez script . It consists of...

Popular posts