Posts

explain classification of PRAM model

explain classification of PRAM model The PRAM model is an extension of the familiar RAM model of sequential computation that is used in algorithm analysis. We will use the synchronous PRAM which is defined as follows. 1. There are p processors connected to a single shared memory. 2. Each processor has a unique index 1 <=   i <=   p called the processor id . 3. A single program is executed in single-instruction stream, multiple-data stream (SIMD) fashion. Each instruction in the instruction stream is carried out by all processors simultaneously and requires unit time, regardless of the number of processors.

Gustafson’s law

Image
Gustafson’s law :- Gustafson's Law says that if you apply   P   processors to a task that has serial fraction   f , scaling the task to take the same amount of time as before, the speedup is Gustafson demonstrated with a 1024-processor system that the basic presumptions in Amdahl’s Law are inappropriate for massive parallelism [Gustafson88]. Gustafson found that the underlying principle that “the problem size scales with the number of processors, or with a more powerful processor, the problem expands to make use of the increased facilities is inappropriate” [Gustafson88]. Gustafson’s empirical results demonstrated that the parallel or vector part of a program scales with the problem size. Times for vector start-up, program loading, serial bottlenecks, and I/O that make up the serial component of the run do not grow with the problem size

Moore law and Amdahl law

  Moore law :- The   observation   that   steady   technological   improvements   in miniaturization   leads   to   a   doubling   of   the   density   of   transistors   on   new integrated   circuits   every   18   months.   In   the   mid-1960s,   Gordon   Moore (born   1929),   one   of   the   founders   of   Intel   corporation ,   observed   that the   density   of   transistors   had   been   doubling   every   year,   although   the pace   slowed   slightly   in   the   following   years.   The   18-month   pattern   heldtrue   into   the   21st   century,   though   as   technology   approaches   thepoint   where   circuits   ar...

Life cycle of Servlet

Image
Life cycle of Servlet :- The life cycle of a servlet can be categorized into four parts: 1.      Loading and Inatantiation:  The servlet container loads the servlet during startup or when the first request is made. The loading of the servlet depends on the attribute of web.xml file. If the attribute has a positive value then the servlet is load with loading of the container otherwise it load when the first request comes for service. After loading of the servlet, the container creates the instances of the servlet.

Write a menu driven program to perform insert and delete operations in a circular linked list

#include #include #include #include #include int insbeg(int item); int inspos(int item); int insend(int item); int length(); int delbeg(); int delpos(); int delend(); struct node {             int info;             struct node *link; }; typedef struct node n1; n1 *last = NULL; n1 *currptr, *newnode, *preptr;

Write a program to add two polynomials using a linked list

#include #include #include struct poly_node {             int coeff, expo;             struct poly_node *link; }; typedef struct poly_node poly; poly *insert_polynode(int, int, poly*);

Depth first search (DFS)

This is a very simple type of brute force searching techniques. The search begins by expanding the initial node i.e. by using an operator generate all successors of the initial node and test them. This procedure finds whether the goal can be reached or not but the path it has to follow has not been mentioned. Diving downward into a tree as quickly as possible performs DFS searches. Algorithm: