Posts

TREAPS

Image
 treaps= trees + heaps INRODUCTION 1.     every node in treap data structure has two main entities  first is key which is component for tree                   property and second is priority which components for min heap property. 2.     if node1 has higher property than node2 then node2 will lie below the node 1 & if key of node1 is less         than key of node2 then node1 will lie in left side of tree and node2 will lie on right side of tree. OPERATIONS 1.      Search =>  time for successfull search is proportional to depth of node & time of unsuccessfull                                         search    is proportional to depth of node. 2.     Insertion=> First we will do normal search tree insertion, th...

STUDENT INFORMATION USING QRCODE

PROBLEM => we don't have a good system for identifying college students in labs,clg gates and libraries. SOLUTION =>       1. We are going to make QR CODE SYSTEM.          2. Convert the student data into QR CODE and store it in the database.     3. Make an application that will scan the QR CODE and which will display the student details. TECHNOLOGY TO BE USED => basic python and kivy BASIC PROJECT ROADMAP =>     1.Collect the data.(Profile image,mis,name,batch)     2.Convert the data into QR CODE.     3.Print the QR CODE.     4.Scan the QR CODE and display the data.

ADJACENT MATRIX

Image
 This usually used in representation of graphs.If there are n vertices in graph then there are  n rows and n columns in matrix. Let us take Ith row and Jth column then A[I][J] represents the edge between two nodes I  & J.If a[I][J] == 0 then there is no edge between node I and node J & if A[I][J] == 1 then there is edge. These type of graph representation is used when there are more number of edges.Reason is that if there are e less number of edges then lot of space will wasted in storing the zeroes which is not good thing. Following is the graph  and its adjancy matrix =>      # include < stdio.h > # include < stdlib.h > int main () {     // n is number of edges     int n ;     printf (" Enter the number of edges => ");     scanf (" %d ", & n );     // construct adjancy matrix     int adjMatrix [ n + 1 ][ n + 1 ];     // iterate for status of connect...

LOWEST COMMON ANCESTOR IN BST

 PROBLEM => FIND THE LOWEST COMMON ANCESTOR OF TWO NODES (a & b) IN BINARY                                        SEARCH TREE STEPS =>  1.Find whether these two nodes are present in bst.If not found then return NULL. 2.If both nodes are found then there are 4 possibilites =>                    1.root == a || root == b => return root                    2.a is found in left subtree and b is found in right subtree => return NULL from that subtree                                  where we cant find both a & b                    3.if a and b are found in left/right subtree return root node * lca...

RAM & CPU

  1.      WHAT IS THE SIGNIFICANCE OF RAM? =>    RAM  acts as temporary memory when you are working on some software applications. They store the data which we give to the software application when we are using it, when the application is used data is lost. 2.      CPU & RAM => CPU is the brain and RAM is the memory that is used by the CPU.

REGISTERS AND RAM

 1.      Why are registers used instead of RAM? =>     Because registers are very fast computer memory which is used to execute programs and operations efficiently. STRUCTURE AND COMPONENTS OF ALL REGISTERS 1. Accumulator => Stores the value from the MDR register 2. Memory Address Register => It holds the address of the location which is to be accessed from the memory 3. Memory Data Register => It holds the data to be written into the memory of to be read out from the addressed location MAR and MDR facilitate the communication between CPU and RAM 4.General-Purpose Register => Used to store temporary data during ongoing operation 5. Program Counter => used to keep track of the execution of the program 6. Instruction Register => Holds the instruction which is to be executed currently. 7. Condition code register => It has many flags that indicate the current status of any operation.

FETCH DECODE EXECUTE CYCLE

  FDEC (FETCH DECODE AND EXECUTE CYCLE) shows how basically a computer CPU works. First understand the components of CPU => 1.      ALU (Arithmetic Logic Unit) - From its name, we come to know that it it performs arithmetic operation of CPU like addition and subtraction. 2.     PC (Program Counter) - Address where computer will look for instruction 3.     MAR (Memory Address Register) - Computer needs somewhere to store address of current instruction being executed. 4.     MDR (Memory Data Register) - Data copied from address present in MAR is stored in MDR. 5.     IR (Instruction Register) - If data in MDR is instruction then it is stored in IR . 6.     Control Unit - data from IR is fetched and decoded into two parts opcode and operand by Control Unit 7.     Acc (Accumulator) - Executed data is stored in MDR if it is not instruction then it is stored in Accumulator. FETCH : 1.      Comput...