About Me

My photo
Vijayapur, Karnataka, India
I am interested in Teaching.

Tuesday 28 February 2017

Design and Analysis of Algorithms: Assignment-II

1. Discuss the importance of "Asymptotic Notations" used by computer professionals.

Explanation of each notation: 1m
Definition of each notation: 2m
Figure showing the order of growth: 2m
Minimum 2 examples: 1m
Total=6 marks x 3 Notations=18 Marks.


2. Write short note on "little-oh notation" (1+1+1=3m)

3. Write the 'General Plan to find time efficiencies' for non-recursive algorithms with example. (5m)

4. Write pesudocode and find the time efficiency of following algorithms. (5 x 10m=50 marks)
    
    To find largest element in a list of n numbers.

     Pseudocode=3m
     Five Steps to find Time Efficiency= 5m
     Total=10m.

    Element Uniqueness Problem.
    Product of 2 matrices A and B. (Matrix Multiplication)
    To find the number of binary digits in a binary representation of decimal number.

5. Prove the following  THEOREM (5m)

    If t1(n) = O(g1(n)) and t2(n) = O(g2(n)) then
        t1(n)+t2(n) = O(max{g1(n),g2(n))



    




Sunday 26 February 2017

PCD Assignment-II

1. Explain in brief about 'STRUCTURE OF C PROGRAM' with programming example. (1+2+2+2=7m)
Distribution of marks:
What is structure of C program= 1m,
Structure=2m,
Explanation of all parts=2m,
Programming Example=2m, Total=7 marks.
Write this answer twice, if you are not confident; otherwise, once in assignment book.

2. What are C-tokens? List and explain in brief with examples. (1+1+6=8 marks)
Distribution of marks:
What are C-tokens= 1m,
List=1m,
Explanation of all=6 X 1 m=6m
Total=8 marks.
Write this answer twice, if you are not confident; otherwise, once in assignment book.

3. Write the rules for defining identifiers/variables with valid and invalid examples for each rule. (2.5+2.5=5 marks)
Distribution of marks:
Minimum 5 rules = 2.55m,
Valid and Invalid Examples for each rule=2.5m
Total=5 marks.
Write this answer twice, if you are not confident; otherwise, once in assignment book.

4. What is variable? How do you define(declare) and initialize? Explain with syntax and examples.
(2+3+3=8 marks)
Distribution of marks:
Definition of variable = 2 m
Declaration of variables= Syntax+Explanation+Examples=3m
 Initialization of variables= Syntax+Explanation+Examples=3m
Total=8 marks.
Write this answer twice, if you are not confident; otherwise, once in assignment book.

5. Design and Develop C programs for following. (5 x 5=25 marks)

C program to find largest of two numbers using simple if statement.
C program to find largest of three numbers using simple if statement.
C program to find largest of two numbers using  if else statement.
C program to find largest of three numbers using if else statement.
C program to check, whether the year is leap year or not leap year.

Sunday 19 February 2017

P C D Notes Page 1 of Module 1

Introduction to Computers and Programming
What is a computer?
Computer is an electronic computing device. It receives raw data as in input, process and generates desired as an output. If necessary, the input and output can be stored within computer’s secondary memory for future use.
Functions of a computer: The major four function of a computer system are as follows.
1. Input (reads raw data as input from user’s of machine)
2. Process (processes the input by using set of programs)
3. Output (result will be generated and displayed/printed)
4. Store (stores input & output within secondary memory)
What is computer program?
The set of instructions/statements/commands given to a machine by the programmer to do specific task is called computer program.
Who is programmer?
The person, who writes computer programs using(learning) computer programming languages like ALGOL, B, BCPL, C, C++, Fortran, COBOL, HTML, C#,Python, and Perl,etc.
Types of Computer Languages:
1. Machine level language (low level)
Machines knows, only 0s and 1s (binary digits i.e. bits) . It is difficult for the programmer to give instructions in machine level language to solve problem. Hence, researchers developed assembly and high level languages.
2. Assembly level language
The researchers developed assembly level languages to make computer programming easier. In this type, programmers will use mnemonics or abbreviations like ADD, SUB, MUL, DIV, STO, PRT, R1, R2, MOV, etc to give instruction to a machine.
e.g. MASAM (Microsoft’s Assembler)
Assembler: The translator or system program that converts the program written in assembly language in to machine language.
3. High level language
The researchers developed high level language to make computer programming easier. In this type, programmer makes the use of English words and mathematical operators and expression to write computer programs to do specific task. This language is easier to learn and write computer programs. Examples. ALGOL, B, BCPL, C, ANSI C, ISO C, C99, C++, Java, Python,etc.
Compiler: The translator or system program that converts the program written in high level language in to machine language at once.

Interpreter: The translator or system program that converts the program written in high level language in to machine language line by line (statement by statement).


Write a c program to display the “Hello World!” message on screen.
/* a c program to display the “Hello World!” message */
# include<stdio.h>
void main()
{
clrscr();
printf(“Hello World!”);
getch();
}

Write a c program to find addition of 2 unknown whole numbers.
/* a c program to find addition of two numbers */
# include<stdio.h>
void main()
{
int n1,n2,ans;
clrscr();
printf(“Enter any two numbers ”);
scanf(“%d%d”,&n1,&n2);
ans=n1+n2;
printf(“\n Addition is %d ”,ans);
getch();
}

Assignments: Write C programs for the following by your own.
1. To find addition of three unknown whole numbers.
2. To find addition of three unknown real numbers.
3. To find area and circumference of a circle.
4. To convert temperature reading from Fahrenheit to Celsius.
5. To find simple interest.
6. To find area and perimeter of a rectangle.
7. To find area of triangle by reading breadth and height of it.
8. To find area of triangle by reading 3 sides of it.
9. To swap (interchange) the contents of two variables (computer’s memories) using temporary variable.
10. To swap (interchange) the contents of two variables (computer’s memories) without using temporary variable.
11. To find square and cube of a number.

12. To extract and display last digit of entered number.

Friday 17 February 2017

Design and Analysis of Algorithms Assignment-1

Dear student, you are hereby informed to answer the following questions by reading recommended text books in your own sentences.

1. What is an algorithm?
    (Definitions made by both Lavitin and Sahani with all necessary diagram and criteria)

2. Explain "The process of Design and Analysis of Algorithms" with neat diagram in brief.

3. Explain 10 specifications to write pseudocode in brief with examples. (Algorithm Specifications)

4. Write short note on "Analysis Framework".

5. Write algorithms to find gcd(m,n) by three methods.

Monday 13 February 2017

PCD Assignment I

Dear student,
     Answer the following questions in your own sentences after reading the recommended text books.

1. What is computer?
2. List the major four functions of a computer system.
3. List the best features of a computer system.
4. List the areas in which computers are widely used to solve technical problems.
5. Write short note on "Types of computers memories".
6. What is the unit of computer's memory?
7. Fill in the blanks
    bit stands for ______________
    ___ bits = 1 nibble
   1 byte = ___ bits
   1024 bytes = ___ Kilo Bytes(KB)
   1024 KB = ___ Mega Bytes(MB)
   1024 MB = ___ Giga Bytes(GB)
   1024 GB = ___ Tera Bytes(TB)
   1024 TB = ___ Peta Bytes(PB)
8. What is computer program?
9. What is the difference between computer program and computer software?
10. Who is a computer programmer?
11. Who are end users?
12. Why do we learn and use computer languages.
13. Write short note on "Types of Programming Languages".
14. What is the difference between between assembler, compiler and interpreter.
15. Why do we write computer programs?


Write the C programs for following.
1. To display "Hello World!" message on the screen.
2. To display "Your residential address" on the screen.
3. To find addition of two unknown whole numbers.
4. To find addition,subtraction,multiplication,division of two unknown whole numbers.
5. To find area and circumference of a circle.
6. To find area and perimeter of a rectangle.
7. To find area of triangle of reading breadth (b) and height (h) of it.
8. To find area of triangle of reading 3 sides of it a, b and c.
9. To find simple interest.
10. To covert temperature reading from Fahrenheit to Celsius.
11. Write your own programs. (minimum 3)

Note: 1. Write the output of a written program.
          2. If you have your own personal computer, please write these programs and execute.
  
 
     
     






Sunday 12 February 2017

Introduction Class : Programming in C and Data Structures.

Institute Vision
To emerge as a Widely Acknowledged (recognized/approved/accredited) Centre in Technical Education and Research to Cater (provide) the need of Society with a Futuristic (innovative) outlook.
Institute Mission
To Enrich (develop) Students with the essence of science and engineering knowledge, Professional ethics (moral values) and social values.
To instill (inspire/encourage) creativity and Research Temperament (character/spirit) to Reach the Greater Heights of Professional (expert/qualified/trained) Success.

Vision of Computer Science and Engineering Department
To be a Trend Setting Department in Technical Education and Research Providing Highly Competent, Efficient Manpower to Meet the Ever Changing Needs of the Country, Industry and the Society.
Mission of Computer Science and Engineering Department
To be an Ideal (perfect/best) Department Providing Quality Technical Education and Training to the Students in Tune with the Evolving Challenges and Social Needs through a Flexible and Innovative (new, novel) Learning Process Enabling the Students to Excel in their Professions and Careers with High Degree of Integrity(honesty, truth) and Ethical (moral, principled) Standards.

Who is an engineer?
A person who designs, builds, or maintains engines, machines, or structures.
What is engineering?
“Engineering can be defined as the branch of science and technology concerned with the design, building, and use of engines, machines, and structures.

Albert Einstein, one of the world's greatest scientists, hit the nail right on the head when he pondered the question 'what is engineering?'.
In simple terms, engineers identify a problem, and come up with a solution – often creating something completely new in the process.
Engineers are shaping the future by applying their skills to almost everything you can think of, from medicine to renewable energy, food technologies to sustainable mining. There really is no limit to what engineers can do.
Literature Survey on Engineering Colleges in India
There are 201 engineering colleges affiliated to VTU.
The state of Andhra Pradesh alone has more than 700 colleges.
511 Engineering colleges in 2006-07 in India.
3,345  Engineering colleges in 2014-15 in India.

Approximate number of engineering students passed out every year in India is as follows.
Passing Students x No. of Institutes in India i.e. 500 x 4000 = 20,00,000
20,00,000 (20 Lakhs) students will be passed out every as a engineering graduate student.


Programming in C and Data Structures (15PCD13/23)
Syllabus at Glance

Module I          Introduction to C Language
Module  II       Branching and Looping
Module III      Arrays, Strings and Functions
Module IV      Structures and File Management
Module V        Pointers and Pre Processors, Introduction To Data Structure

Course Outcomes (COs): On completion of this course, students are able to
C113.1 Explain the basic principles of programming in C language.
C113.2 Apply the knowledge of control statements to write computer programs.
C113.3 Write the computer programs using arrays, strings and functions.
C113.4 Design and develop solutions to real world problems by using computer programming skills.
C113.5 Construct structures and files to store data for further use.
C113.6 Define and use various data structures using pointers to handle huge data.

TEXT BOOKS:
T1. Brain W. Kernighan and Dennis M. Richie: The C programming Language, 2nd Edition, PHI, 2012.
T2. Jacqueline Jones & Keith Harrow: Problem Solving with C, 1st Edition, Pearson 2011.
REFERENCE BOOKS:
R1. Vikas Gupta: Computer Concepts and C Programming, Dreamtech Press 2013.
R2. R S Bichkar, Programming with C, University Press, 2012.
R3. V Rajaraman: Computer Programming in C, PHI, 2013.

Define the following terms.
  • Computer
  • Functions
  • Applications
  • Features
  • Program
  • Sofware (System & Application)
  • Programmer
  • Programming
  • Programming Languages
Write the C programs for following.
Too display "Hello World" message on the screen.
To display your residential address on the screen.
To read and find the addition of two unknown whole numbers.

Syllabus



Tuesday 7 February 2017

DBA Viva Voce

What is Data?
Data is a collection of facts, such as numbers, words, measurements, observations or even just descriptions of things.
Data are plain facts. The word "data" is plural for "datum." When data are processed, organized, structured or presented in a given context so as to make them useful, they are called Information.
What is information?
Information is data that has been processed in such a way as to be meaningful to the person who receives it. It is anything that is communicated.
What is database?
A database is an organized collection of data. It is the collection of schemas, tables, queries, reports, views, and other objects.
The term "schema" refers to the organization of data as a blueprint of how the database is constructed (divided into database tables in the case of relational databases).
What is DBMS?
“A database management system (DBMS) is system software for creating and managing databases. The DBMS provides users and programmers with a systematic way to create, retrieve, update and manage data.”
“A database management system (DBMS) is a computer software application that interacts with the user, other applications, and the database itself to capture and analyze data.”
What is RDBMS?
RDBMS is the basis for SQL, and for all modern database systems like MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access. A Relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as introduced by E. F. Codd.
What is SQL?
SQL stands for Structured Query Language. SQL is used to communicate with a database. According to ANSI (American National Standards Institute), it is the standard language for relational database management systems. SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database. Some common relational database management systems that use SQL are: Oracle, Sybase, Microsoft SQL Server, Access, Ingres, etc. The standard SQL commands such as "Select", "Insert", "Update", "Delete", "Create", and "Drop" can be used to accomplish almost everything that one needs to do with a database.

Selecting Data

The select statement is used to query the database and retrieve selected data that match the criteria that you specify. Here is the format of a simple select statement:
select "column1"
  [,"column2",etc] 
  from "tablename"
  [where "condition"];
  [] = optional

Creating Tables

The create table statement is used to create a new table. Here is the format of a simple create table statement:
create table "tablename"
("column1" "data type",
 "column2" "data type",
 "column3" "data type");
Here are the most common Data types:
char(size)
Fixed-length character string. Size is specified in parenthesis. Max 255 bytes.
varchar(size)
Variable-length character string. Max size is specified in parenthesis.
number(size)
Number value with a max number of column digits specified in parenthesis.
date
Date value
number(size,d)
Number value with a maximum number of digits of "size" total, with a maximum number of "d" digits to the right of the decimal.

Inserting into a Table

The insert statement is used to insert or add a row of data into the table.
insert into "tablename"

 (first_column,...last_column)

  values (first_value,...last_value);

Updating Records

The update statement is used to update or change records that match a specified criteria. This is accomplished by carefully constructing a where clause.
update "tablename"

set "columnname" = 

    "newvalue"

 [,"nextcolumn" = 

   "newvalue2"...]

where "columnname" 

  OPERATOR "value" 

 [and|or "column" 

  OPERATOR "value"];

Deleting Records

The delete statement is used to delete records or rows from the table.
delete from "tablename"

where "columnname" 

  OPERATOR "value" 

[and|or "column" 

  OPERATOR "value"];

Drop a Table

The drop table command is used to delete a table and all rows in the table.
drop table "tablename"


Keys in DBMS

Key plays an important role in relational database; it is used for identifying unique rows from table. It also establishes relationship among tables.

Types of keys in DBMS

Primary Key – A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table.
Super Key – A super key is a set of one of more columns (attributes) to uniquely identify rows in a table.
Candidate Key – A super key with no redundant attribute is known as candidate key
Alternate Key – Out of all candidate keys, only one gets selected as primary key, remaining keys are known as alternate or secondary keys.
Composite Key – A key that consists of more than one attribute to uniquely identify rows (also known as records & tuples) in a table is called composite key.
Foreign Key – Foreign keys are the columns of a table that points to the primary key of another table. They act as a cross-reference between tables.

Super Key

A Super key is any combination of fields within a table that uniquely identifies each record within that table.

Candidate Key

A candidate is a subset of a super key. A candidate key is a single field or the least combination of fields that uniquely identifies each record in the table. The least combination of fields distinguishes a candidate key from a super key. Every table must have at least one candidate key but at the same time can have several.
1. Candidate Key: are individual columns in a table that qualifies for uniqueness of all the rows. Here in Employee table EmployeeID & SSN are Candidate keys.
2. Primary Key: is the columns you choose to maintain uniqueness in a table. Here in Employee table you can choose either EmployeeID or SSN columns, EmployeeID is preferable choice, as SSN is a secure value.
3. Alternate Key: Candidate column other the Primary column, like if EmployeeID is PK then SSN would be the Alternate key.
4. Super Key: If you add any other column/attribute to a Primary Key then it become a super key, like EmployeeID + FullName is a Super Key.
5. Composite Key: If a table do have a single columns that qualifies for a Candidate key, then you have to select 2 or more columns to make a row unique. Like if there is no EmployeeID or SSN columns, then you can make FullName + DateOfBirth as Composite primary Key. But still there can be a narrow chance of duplicate row.
What is ER diagram?
An entity relationship model, also called an entity-relationship (ER) diagram, is a graphical representation of entities and their relationships to each other, typically used in computing in regard to the organization of data within databases or information systems.
Let us now learn how the ER Model is represented by means of an ER diagram. Any object, for example, entities, attributes of an entity, relationship sets, and attributes of relationship sets, can be represented with the help of an ER diagram.

Entity

Entities are represented by means of rectangles. Rectangles are named with the entity set they represent.
Entities in a school database

Attributes

Attributes are the properties of entities. Attributes are represented by means of ellipses. Every ellipse represents one attribute and is directly connected to its entity (rectangle).
Simple Attributes
If the attributes are composite, they are further divided in a tree like structure. Every node is then connected to its attribute. That is, composite attributes are represented by ellipses that are connected with an ellipse.
Composite Attributes
Multivalued attributes are depicted by double ellipse.
Multivalued Attributes
Derived attributes are depicted by dashed ellipse.
Derived Attributes

Relationship

Relationships are represented by diamond-shaped box. Name of the relationship is written inside the diamond-box. All the entities (rectangles) participating in a relationship, are connected to it by a line.

Binary Relationship and Cardinality

A relationship where two entities are participating is called a binary relationship. Cardinality is the number of instance of an entity from a relation that can be associated with the relation.
·        One-to-one − When only one instance of an entity is associated with the relationship, it is marked as '1:1'. The following image reflects that only one instance of each entity should be associated with the relationship. It depicts one-to-one relationship.
One-to-one
·        One-to-many − When more than one instance of an entity is associated with a relationship, it is marked as '1:N'. The following image reflects that only one instance of entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts one-to-many relationship.
One-to-many
·        Many-to-one − When more than one instance of entity is associated with the relationship, it is marked as 'N:1'. The following image reflects that more than one instance of an entity on the left and only one instance of an entity on the right can be associated with the relationship. It depicts many-to-one relationship.
Many-to-one
·        Many-to-many − The following image reflects that more than one instance of an entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts many-to-many relationship.
Many-to-many

Participation Constraints

·        Total Participation − Each entity is involved in the relationship. Total participation is represented by double lines.
·        Partial participation − Not all entities are involved in the relationship. Partial participation is represented by single lines.