Saturday, 17 July 2021

Introduction to c: free job alert computers material for competative exams

Introduction to c: free job alert computers material for competative exams

Variables : It is a temporary buffer name it is also memory identifier also called as literal

Rules: (namingconventions)

Must ba  a letter can not start with number or operator may be it starts with underscore(_) can not support special characters it may start with either upper case or lower case letters

Syntax :  variable declaration

<data type>  <variable name> =<value>(optional>

Int x;

Int –x;

Int –x-x-;

Int account number int x= 5;

What is a variable?

a)   To store data permanently B)  identifier for the memory c) keyword d) none

Ans )   B

Which of the following is the optional part for variable declaration ---- value

Which of the following is true about variable?

Must ba a letter may be starts with underscore

Logical operators:

Logical operators are used to implement multiple conditions in a single expression

Ex : logical and (&&) , logical or ,logical not(!)

Logical and :

                                       I1        i2            o/p

                                       T        T               T

                                       T        F               F

                                       F        T               F

                                       F         F              F

Eapressions : it is a collection of variables and operator with semi coloun

Ex :  a+b ;  ----statement

A+b --- expression

These are used to generate statements some expressions are based on special characters like (,),{,}

Ex: (a*b)+(b*b)

Which of the following is true about expressions?

a)   It containd left (,)

b)  It uses in build methods (power,sqrt)

c)    Both d) none

Ans : both

Which of the following mechanism is used to convert mathematical notation into system notation ----------expressions

Which of the following operator are used in expressions

a)   Arithmetic operators B) (,),[,],{,}

b)  Relational operators d)   all

D correct answer

Operators in programming languages:

·     Arithmetic * relational    * logical * conditional operators

Arithmetic :  +,-,*,++,--,

What is the value of integer division quotient

Which of the following is the as of mod reminder

Which of thefollowing is the value of mod reminder

++ it is used to increase value by 1

There are two ways of implementation in ++operator

·     Pre increment   * post increment

Preincrement : this value is incremented by 1

 First increase the value then after that execute the variable

                     Int x = 5

                       Pf(“%d”,++x)

                 6

Post increment : first execute the variable then after that increase the value by 1

                            Int x =5

                                Pf(“%”,x++)

5

Oops: object oriented programming structure

Programming execution from bottom to top memory instantiation  is mandatory

Driver code blocks is mandatory

Business logic is a client request structure /output format

Driver block contains the following

1.   Used defined function    2) looping blocks    3)main method 4) non of the above

What is the main use of driver block

1  buffer allocation 2  instance allocation     3   execute business logic    4 all of the above

Code blocks :

It is piece of programme code

It is used to identify the limited set of instructions toperform some logic

It is snippet

Functions methods modules member functions ping statements conditional statements

Importance of oops:

To divide the program into pieces these pieces is called as classes

Run time buffer allocation message passing application

Class :

It is a code block it is used to integrate data members and member functions

It is used to create ADT(abstract type data)

It is usedth declare object

Syntax : class<class name >{

                 --------------

                 -------------

}

Types of classes in oops  :

1 object class 2  driver class

Object class :

It is used to implement business logic 

Object classes is used in all oops concepts

Syntax class <class name > {

                                      ------------------

                                               }

Driver class :

Public modifier is mandatory for all driver classes it contatins main method

It is used to allocate runtime buffer

It is not used by c++

C++ uses dynamic buffers

For every driver class default constructor is invoked automatically

It uses period(.) operator there is no use of period operator in object class

Period operator :

To create a relationship between object and member function

<object name >. <method name >();

Test      t;

t.display();

relation (table)

in c++ there is no driver class to invoke all the methods  which are available in the object class

syntax :

public class <class name >

which of the following is  a modifier in a driver classesin oops

private static public none

how to execute classes

object     ide  driver                    none

 

MCQS:

Which of the following is not a limitation of binary search algorithm?

a)   Must use a stored array

b)  Requirement of sorted array is expensive when a lot of insertion and deletions needed

c)    There must be a mechanism to access middle element directly

d)  Binary search algorithm is not efficient when the data elements are more thn 1000\

Ans :  d

Two dimentional arrays are also called as

a)   Table arrays

b)  Matrix arrays

c)    Both of the above

d)  None of the above

 

Ans : c

A variable p is called pointer if

a)   P points the address of an element in data

b)  P points to the addres of first element in the data

c)    P can store only memory address

d)  P contain the data and the address of data

Ans : a

Which of the following data structure cant store the non homogeneons data elements

Arrays       records   pointers        non     

Arrays

Which of the following data structure store the homogenious data elements

Arrays records pointers none

Records

Each data item in a record may be a group item composed of sub items those items which are indecomposable are called

a)   Elementary items

b)  Atoms]

c)    Scalars

d)  Has next {}

Ans : b

What happens when you push  a new node on to a stack

a)   The new node is placedat the front of the linked list

b)  The new node is placed at the back  of the linked list

c)    The new node is placed in the middle of the linked list

d)  No change happens

Ans   a

The memory address of the first element of an array is called

a)   Floor address

b)  Foundation address

c)    Base address

d)  First addres

Ans  c

The array address of fifth element of an array can be calculated by

LOC(Array[5]=Base(Array)+w(5-lower bound),where w is the number of words per memory cell for the array

Which of the following data structure are indexed structures

a)   Linked arrays

b)  Linked lists

c)    Both of the above

d)  None of the above

Ans : a

Which of the following is not the required condition for binary search algorithm

A)  The list must be stored

B)  There should be the direct access to the middle element in any sublist

C)  There must be mechanism to delete and/or insert elements in the list

D) None of the above

Ans : c

DATA STRUCTURES :

Note: this mcqs on data structures concepts as per the digital as per syllabus

Topics :

a)   Introduction to data structure

b)  Stacks and queues

c)    Linked lists

d)  Trees

e)   Graphs

f)     Linear search and binary search

g)   Sorting techniques

On which principle does stack work?

a)   Fifo   b)   filo   c)  lilo    d) both  a and c

Ans :  A

Can linked list be implemented using arrays?

A )  yes    B)    no

Ans :  a

Two dimentional arrays are also called

A)  Table arrays

B)  Matrix arrays

C)  Both of the above

D) None of the above

Ans :  c

AVL trees have a faster retrieval

Which of the following statements hole true of binary trees

a)   The left subtree of a node contains only nodes which keys less than the node’s key

b)  The right sub tree of a node contains only nodes with keys greater than the nodes key

c)    Both a and b

d)  None left and right subtree nodes contains only nodes with keys less than the nodes key

Ans : c

The time required in best case for search operation in binary trees is O(nlog n)

Can stack be described as a pointer yes

What is the peculiarity of red blac tree

a)   In red black trees the root do not contain data

b)  In red black tree the leaf nodes are not relevant and donot contain data

c)    In red black trees the leaf nodes are relevant but do not contain data

d)  Both a and c above

Whcich of the following ways below is a pre order traversal

Root >leftsub tree >right sub tree

Which of the following linked list below have last node of the list pointing to the fisrt node

a)   Circular doubly linked list

b)  Circular linked list

c)    Circular single linked list

d)  Doubly linked list

Items in a priority queue are entered in a random order

A tree can not contain true cycles

A degenerate tree is a tree where for each parent node there is only on eassociated child node

In a binary tree certain null entries are replaced by special pointers which point to nodes higher in the tree for efficiency these special pointers are called thread

The in order traversal of tree will yield a sorted listing of elements of tree in binary search trees

In a heap tree values in a node is greater than every value in children of it

In graph  if e=[u v ] then u and v are called end points of e, adjacent nodes,neighbours

A connected graph t without any cycle is called a tree graph , free tree, a tree

If every node u and g is adjacent to every other node v in G ,a graph is said to be complete

In a linked list there are no null links circular linked list

If yyy,xxx and zzz are the elements of a lex I cally ordred tree then in pre order traversal which node will be traverse fisrt xxx

In a balance binarytree the height of two sub trees of every node con not differ by more than one

In a binary tree certain null entries are replaced by special pointers which point to nodes higher in the tree for effiency these special pointers are called thread

The in order traversal of tree will yield a sorted listing of elements of tree in binary search trees

In a heap sort values in a node is greater than every value in children of it

In a graph if e=(u,v) means  u is processor and v is successor

The main measures for the efficiency of a algorithm are time and space

The time factor when determining the efficiency of algorithm is measured by counting the number of key operations

 

The space factor when determining the efficiency of algorithm is measured by counting the maximum memory needed by the algorithm

Null case doesnot exist in complexity theory

The work case occur in linear search algorithm item is the last element in the array or is not there at all

The average case occur inlinear search algorithm 10

Tree :

It is a non linear data structure first node is a root node last node is called as the leaf node always left side values less than or equal to the root value always left values less than the right value

Key points:

Path : it refers to the sequence of nodes along with edges of a tree edges are used to generate paths

Root : the node at the top level

Level zero node

Parent : any node exact the root has one edge connected to child

Child : a node below given node connected by its edge down word is called as child node

Leaf : end nodes last nodes of a tree a node there is no child nodes

Visiting node : cursor location node visiting refers checking value of a node when control is on the particular node

Traversing : passing through nodes in a special order

Levels : level of a node represents the generations of a node

Keys : keys represents value of a node based on which a search operation is to be carried out for a node

Binary tree : it is a special data structure used for data storage purpose binary tree has a special condition

Each node can have maximum of two childs binary tree has the implemented in both arrays and linked lists left sub tree values always less than or equal to the root node

Left sub tree values always less than right sub tree values

Right sub tree values always greater than root

Mimimum how manysub nodes 1

Level zero node is called root node

Tree traversal techniques :

In order traversal

Pre order traversal

Post order traversal

Inorder traversal :

Visit the root node move to its left repeat the step until no left encounter

Inside the left node in a queue come to the immediate parent and put it in a queue and checks for it right node and repeat the process

Come to the immediate parent node and put it in a queue and checks for it right node and repeat the process if th total left sub tree is completed thn come to th root then put it in a queue

Repeat the same process for all nodes

Pre order :

First visit the root node and put it in a queue

Move to its left an print the element repeat the step until no left encounters move to its right and display the elements

Repeat the same process up to completion of the left sub tree move to its root right

Then display the elements and repeat

Post odrder :

Visit the root node move to its left upon left encounters and checks for it right if node has no left and no right print the element move to its immediate parent right and repeat the same steps

 

 

 

 

 

 

 

 

 

 

 


Introduction to c: free job alert computers material for competative exams

Introduction to c: free job alert computers material for competative exams Variables : It is a temporary buffer name it is also memory ide...