Follow

This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Translate

Wednesday, May 4, 2016

what is the Complexity of Bubble Sort?

Complexity of Bubble Sort : The time for a sorting algorithm is measured in terms of the number of comparisons. The number f(n) of comparisons in the bubble sort is easily computed.Specially, there are n - 1 comparisons during the first pass, which places the largest element in the last position; there are n - 2 comparisons in the second step, which places the second largest element in the next-to-last position; and so on.  Thus

f(n) = (n-1) + (n-2) + .......... + 2+1 = n(n-1)/2 - n2/2 +0(n) = 0(n2)

In the other words, the time required to execute the bubble sort algorithm is propositional to n2 where n is the number of input items.

Propellerads

If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Saturday, April 30, 2016

/* Another Methods of Traversing in a Linear Array  */

#include<stdio.h>         /* Header File that are called standard input output*/
#include<conio.h>        /* Header File that are called consol input output*/

void main(){       /*start the main function and void that are not return type*/

clrscr();            /* Clear the screen at every time when input new element*/

int LA[] = {20, 65, 73, 88, 33, 95, 25};   /*array that will be stored 5 element*/ 

int k,count =0, LB=0,UB=7;    /*only declare that are integer variable*/
k=LB;
printf("\nThe array contain.....\n");/*Only for print that mean get the output  */

for(k=LB;k<UB;k++){                       /*that are loop k=0,UB=5*/
printf("%d\t", LA[k]);
k++;                           /*increase the loop element */
count++;                  /*to be increase for counting in the array*/

printf("\n\n The number of elements=%d", count);  /* Count the element of array */
getch();   /*keep to stay the screen*/   
}


            index=0,1,2,3,4 there are 5 index element since, there have 5 element that are 5,6,7,8,3
                        0 1 2 3 4

Note:    0=5,1=6,2=7,3=8,4=3

So, when 0<5 that are condition is true and print 0 index that are mean 5 print stil condition 4<5 will be print that are 3 element and next condition 5<5 that are false condition and exit loop.
Here, when print o index and increase the value of loop the 1 and continue 4 and will be exit loop when value is 5.

If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Traversing in a Linear Array

/* Traversing in a Linear Array  */

#include<stdio.h>         /* Header File that are called standard input output*/
#include<conio.h>        /* Header File that are called consol input output*/

void main(){       /*start the main function and void that are not return type*/

clrscr();            /* Clear the screen at every time when input new element*/

int LA[] = {5,6,7,8,3};   /*array that will be stored 5 element*/ 

int k,count =0, LB=0,UB=5;    /*only declare that are integer variable*/
k=LB;
printf("\nThe array contain.....\n");/*Only for print that mean get the output  */

while(k<UB){                       /*that are loop k=0,UB=5*/
printf("%d\t", LA[k]);
k++;                           /*increase the loop element */
count++;                  /*to be increase for counting in the array*/

printf("\n\n The number of elements=%d", count);  /* Count the element of array */
getch();   /*keep to stay the screen*/   
}


            index=0,1,2,3,4 there are 5 index element since, there have 5 element that are 5,6,7,8,3
                        0 1 2 3 4

Note:    0=5,1=6,2=7,3=8,4=3

So, when 0<5 that are condition is true and print 0 index that are mean 5 print stil condition 4<5 will be print that are 3 element and next condition 5<5 that are false condition and exit loop.
Here, when print o index and increase the value of loop the 1 and continue 4 and will be exit loop when value is 5.

If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Procedure P2.9A : CROSSOUT(A, N, K)

1.  If A[K] = 1, then : Return.

2.  Repeat for L = 2K to N by K:

Set A[L] : 1.

[End of loop]

3. Return.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Complexity;Space-Time Tradeoffs

Briefly describe the notations of (a) the complexity of an algorithm and (b) the space-time tradeoff of algorithms  :

(a)  The complexity of an algorithm is a function f(n) which measures the time and/or space used by an algorithm in terms of the input size n.

(b) The space-time tradeoff refers to a choice between algorithmic solutions of a data processing problem that allows one to decrease the running time of an algorithmic solution by increasing the space to store the data and vice versa.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Friday, April 29, 2016

Program to convert an Expression from Infix to Postfix

#include<stdio.h>
#include<stdlib.h>

#define MAXCOLS 80
#define TRUE 1
#define FALSE 0

void postfix(char*, char *);
int isoperand(char);
void popandtest(struct stack*, char*, int*);
int prcd(char, char);
void push(struct stack*, char);
char pop(struct stack*);


void main(){
char infix[MAXCOLS];
char postr[MAXCOLS];
int pos = 0;

while ((infix[pos++] = getchar()) != '\n' );
infix[--pos]='\0';
printf("%s%s", "the original infix expression is", infix);
postfix(infix, postr);
printf("%s\n", postr);
}   /* end of main */
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Using One-Dimensional Arrays Of C Programming Language

#define NUMELTS 100
void main(){
  
     int num[NUMELTS ];                        /*   array of numbers     */
    int i;
    int total;                                            /*   sum of the number     */
    float avg;                                         /* average of the number  */
    float diff;                                        /*  number and the average */
   
total = 0;
for(i=0; i<NUMELTS; i++){
/*   read the numbers into the array and add them    */ 
scanf("%d", num[i]);
total +=num[i];   
} /* end for  */ 

avg  = (float)total/NUMELTS;                /* computer the average */
printf("\nnumber difference");      /*    print heading   */
/   * print each number and its difference      */

for(i = 0; i<NUMELTS; i++){
 diff = num[i]-avg;
printf("\n%d%f", num[i], diff);

}   /*  end for  */

printf("\naverage is : %f", avg );
}   /* end main */

Learn More from Blog :  

Expert Web Engineering

Expert Computer Networking

Talent Programming Language C

Logical Discrete Mathematics

Expert Compiler Design

Professional Algorithm Design

Professional Responsive Web Page Design By Bootstrap

Talent Software Engineering
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Thursday, April 7, 2016

Evaluation of Postfix Expression

Evaluation of Postfix Expression : 

Algorithm : 

1. Add a right parenthesis ")" at the end of P.   [This acts as a sentinel]

2. Scan P from left to right and repeat Steps 3 and 4 for each element of P until the sentinel ")" is encountered.

3. If an operand is encountered, put it on STACK.

4. If an operator  is encountered, then :

(a) Remove the two top elements of STACK, where A is the top element and B is the next-to-top element..

(b) Evaluate B A

(c) Place the result of (b) back on STACK.

[End of If structure.]
[End of Step 2 loop.]

5. Set VALUE equal to the top element on STACK.

6.Exit.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Arithmetic Expressions;Polish Notation

Arithmetic Expressions;Polish Notation : 


Highest : Exponentiation

Next Highest : Multiplication (*) and Division(/)

Lowest : Addition(+) and Subtruction(-)
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Tuesday, March 22, 2016

Two-Way Header Lists


The advantages of a two-way list a circular header list may be combined into a two-way circular header list as .  The list is circular because the two end nodes point back to the header node.Observe that such a two-way list requires only one list pointer variable START, which points to the header node. This is because the two pointers in the header node point to the two ends of the list.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Inserting into a Sorted Linked List


Suppose ITEm is to be inserted into a sorted linked LIST.  Then ITEM must be inserted between nodes A and B so that

                                                   INFO(A) < ITEM <= INFO(B)

The following is a procedure which finds the location LOC of node A, that is, which finds the location LOC of the last node in LIST whose value is less that ITEM.

Traverse the list, using a pointer variable PTR and comparing ITEM with INFO[PTR] at each node. While traversing, keep track of the location preceding node by using a pointer variable SAVE

SAVE : = PTR    and   PTR : = LINK[PTR].

The traversing continues as long as INFO[PTR]  > ITEM, or in the words, the traversing stops as soon as ITEM <= INFO[PTR]. The PTR points to node B, so SAVE will contain the location of the node A.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Deletion Algorithms


Algorithms which delete nodes from linked lists come up in various situations. We discuss two of them here. The first one deletes the node following a given node, and the second one deletes the node with a given ITEM of information. All our algorithms assume that the linked list is in memory in the form LIST(INFO, LINK, START, AVAIL).

All of our deletion algorithms will return the memory space of the deleted node N to the beginning of the AVAIL list.  Accordingly,  all of our algorithms will include the following pair of assignments, where LOC is the location of the deleted node N:

LINK[LOC] : = AVAIL and then AVAIL : = LOC


Some of the algorithms may want to delete either the first node or the last node from the list. An algorithms that does so must check to see if there is a node in the list,  If not, i.e, If START = NULL, then the algorithms will print the message UNDERFLOW.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

COPY(INFO, LINK, NAME1, NAME2, AVAIL)



1.     Set NAME2 : = NULL.   [Forms empty  list]

2.   [NAME1 empty?]  If NAME1 = NULL, then: Exit.

3.    [Insert first node of NAME1 into NAME2]
       Call INSLOC(INFO, LINK, NAME2, AVAIL, NULL, INFO[NAME1]) or :
(a)  If AVAIL = NULL, then : Write : OVERFLOW, and Exit.

(b) Set NEW :  = AVAIL and AVAIL : = LINK[AVAIL].   [Removes first node from AVAIL list.]

(c)  Set INFO[NEW] : = INFO[NAME].  [Copies data into new node]

(d)    [Insert new node as first node in NAME2.]

4.    [Initializes pointer PTR and LOC]
         Set  PTR : = LINK[NEW]  and LOC : = NAME2.

5.   Repeat Steps 6 and 7 while PTR != NULL.

6.  Call INSLOC(INFO, LINK, NAME2, AVAIL, LOC, INFO[PTR]) or:

(a)  If AVAIL = NULL, then : Write : OVERFLOW, and Exit.
(b) Set NEW :  = AVAIL and AVAIL : = LINK[AVAIL]. 
(c)  Set INFO[NEW] : = INFO[PTR].    [Copies data into new node]
(d)  [Insert new node into NAME2 after the node with location LOC]
         Set   LINK [NEW] : = LINK[LOC], and LINK[LOC] : = NEW.

7. Set PTR : = LINK[PTR] and LOC : = LINK[LOC].    [Updates PTR and LOC]
[End of Step 5 loop]

8.  Exit.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Monday, March 21, 2016

Insertion Algorithms


(a)  Checking to see if space is available in the AVAIL list.  If not, that is, if AVAIL = NULL, then the algorithm will print the message OVERFLOW.

(b)  Removing the first node from the AVAIL list.Using the variable NEW to keep track of the location of the new node, the step can be implemented by the pair of assignments

NEW : = AVAIL,      AVAIL : = LINK[AVAIL]

(c)  Copying new information into the new node.

                                  INFO[NEW] : = ITEM
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

INSERT(INFO, LINK, START, AVAIL, ITEM)



1.   [Use Procedure FINDA to find location of the node preceding ITEM]
  Call FINDA(INFO, LINK, START, ITEM, LOC)

2.  [Use Algorithm INSLOC to insert ITEM after the node with location LOC.]
  Call INSLOC(INFO, LINK, START, AVAIL, LOC, ITEM)

3. Exit
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

FINDA(INFO, LINK, START, ITEM, LOC)


1.  [List of empty?]   If START = NULL, then : Set LOC : = NULL, and Return.

2.   [Special case?]  If ITEM <  INFO[START], then : Set LOC : = NULL, and Return.

3.  Set SAVE : = START and PTR : = LINK[START].     [Initializes pointers]

4.  Repeat Steps  5 and 6 while PTR != NULL.

5.  If ITEM < INFO[PTR], then:
Set LOC : = SAVE, and Return.
[End of If structure]

6.  Set SAVE : = PTR and PTR : = LINK[PTR].    [Updates Pointers]
[End of Step 4 loop]

7.  Set LOC : = SAVE

8.  Return.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

DELLOCHL(INFO, LINK, START, AVAIL, ITEM)


1.  [Use Procedure FINDBHL to find the location of N and its preceding node.]

  Call LINDBHL(INFO, LINK, START, ITEM, LOC, LOCP).

2.  If LOC = NULL, then : Write: ITEM not in list, and Exit.

3.  Set LINK[LOCP] : = LINK[LOC].   [Deletes node.]

4.  [Return deleted node to the AVAIL list.]
    Set LINK[LOC] : = AVAIL and AVAIL : = LOC.

5.  Exit.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

FINDBHL(INFO, LINK, START, ITEM, LOC, LOCP)

Procedure: FINDBHL(INFO, LINK, START, ITEM, LOC, LOCP)

1.  Set SAVE : = START and PTR : = LINK[START].  [Initializes pointer].

2. Repeat while INFO[PTR] != ITEM and PTR != START.
   Set SAVE : = PTR and PTR : = LINK[PTR].  [Updates Pointers]
[End of loop]

3.  If INFO[PTR] = ITEM, then:
   Set LOC : = PTR and LOCP : = SAVE.

Else: 
Set LOC : = NULL and LOCP : = SAVE.

[End of If structure]

4.  Exit.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

SRCHHL(INFO, LINK, START, ITEM, LOC)



1.   Set PTR : = LINK[START]

2.  Repeat while INFO[PTR] != ITEM and PTR != START:
   Set PTR : = LINK[PTR].    [PTR now points to the next node]
[End of loop]

3.  If INFO[PTR] = ITEM, then:
Set LOC : = PTR.

Else :
Set LOC : = NULL.
[End of structure.]
4.Exit

If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Traversing a Circular Header List

(Traversing a Circular Header List)  Let LIST be a circular header list in memory.  This algorithm traverses LIST, applying an operation PROCESS to each node of LIST.

1.   Set PTR : = LINK[START].   [Initializes the pointer PTR]

2.   Repeat Steps 3 and 4 while PTR != START

3.   Apply PROCESS to INFO[PTR].

4.  Set PTR : = LINK[PTR].   [PTR now points to the next node]
[End of Step 2 loop.]

5. Exit.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Traversing a Circular Header List

(Traversing a Circular Header List)  Let LIST be a circular header list in memory.  This algorithm traverses LIST, applying an operation PROCESS to each node of LIST.

1.   Set PTR : = LINK[START].   [Initializes the pointer PTR]

2.   Repeat Steps 3 and 4 while PTR != START

3.   Apply PROCESS to INFO[PTR].

4.  Set PTR : = LINK[PTR].   [PTR now points to the next node]
[End of Step 2 loop.]

5. Exit.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

DELETION FROM A LINKED LIST


Let LIST be a linked list with a node N between nodes A and B

Suppose node N is to be deleted from the linked list.The schematic diagram of such a deletion appears.The deletion occurs as soon as the nextpointer field of node A is changed so that it points to node B.

Suppose our linked list is maintained in memory in the form
                   LIST(INFO, LINK, START, AVAIL)

When a node N is deleted from our list, we will immediately return its memory space to the AVAIL list.

1.  The nextpointer field of node A now points to node B.  where node N previously pointed.

2.  The nextpointer field of N now points to the original first node in the free pool, where AVAIL previouly pointed.

3.  AVAIL now points to the deleted node N.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

DELETION FROM A LINKED LIST


Let LIST be a linked list with a node N between nodes A and B

Suppose node N is to be deleted from the linked list.The schematic diagram of such a deletion appears.The deletion occurs as soon as the nextpointer field of node A is changed so that it points to node B.

Suppose our linked list is maintained in memory in the form
                   LIST(INFO, LINK, START, AVAIL)

When a node N is deleted from our list, we will immediately return its memory space to the AVAIL list.

1.  The nextpointer field of node A now points to node B.  where node N previously pointed.

2.  The nextpointer field of N now points to the original first node in the free pool, where AVAIL previouly pointed.

3.  AVAIL now points to the deleted node N.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Inserting after a Given Node



1.         [OVERFLOW?]  If AVAIL = NULL,  then:  Write:  OVERFLOW, and Exit.

2.      [Remove first node from AVAIL list.]

3.   Set INFO[NEW] : = ITEM.    [Copies new data into new node.]

4.  If LOC = NULL, then:   [Insert as first node.]
              Set LINK[NEW] : = START and START : = NEW.
Else:     [Insert after node with location LOC.]
             Set LINK[NEW] : = LINK[LOC] and LINK[LOC] : = NEW.
[End of If structure]

5.Exit.

If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Inserting after a Given Node



1.         [OVERFLOW?]  If AVAIL = NULL,  then:  Write:  OVERFLOW, and Exit.

2.      [Remove first node from AVAIL list.]

3.   Set INFO[NEW] : = ITEM.    [Copies new data into new node.]

4.  If LOC = NULL, then:   [Insert as first node.]
              Set LINK[NEW] : = START and START : = NEW.
Else:     [Insert after node with location LOC.]
             Set LINK[NEW] : = LINK[LOC] and LINK[LOC] : = NEW.
[End of If structure]

5.Exit.

If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Sunday, March 20, 2016

Inserting at the Beginning of a List


Algorithm:   INSFIRST(INFO,  LINK,  START, AVAIL, ITEM)


1.     [OVERFLOW?]  If AVAIL = NULL , then : Write: OVERFLOW, and Exit.

2.   [Remove first node from AVAIL list. ]

   Set NEW : = AVAIL and AVAIL : = LINK[AVAIL].

3.  Set INFO[NEW] : = ITEM.  [Copies new data into new node]

4.  Set LINK[NEW] : = START.      [New node now points to original first node.]

5.  Set START : = NEW.     [Changes START so it points to the new node]

6.  Exit
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Inserting at the Beginning of a List


Algorithm:   INSFIRST(INFO,  LINK,  START, AVAIL, ITEM)


1.     [OVERFLOW?]  If AVAIL = NULL , then : Write: OVERFLOW, and Exit.

2.   [Remove first node from AVAIL list. ]

   Set NEW : = AVAIL and AVAIL : = LINK[AVAIL].

3.  Set INFO[NEW] : = ITEM.  [Copies new data into new node]

4.  Set LINK[NEW] : = START.      [New node now points to original first node.]

5.  Set START : = NEW.     [Changes START so it points to the new node]

6.  Exit
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Deleting the Node Following a Given Node




1  If LOCP = NULL, then:

    Set START : = LINK[START].     [Deletes first node]

Else: 
       Set LINK[LOCP]  : = LINK[LOC].    [Delete node N.]

[End of structure .]

2.      [Return  deleted node to the AVAIL list.]

     Set LINK[LOC]  : = AVAIL and AVAIL : = LOC

3.  Exit
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Deleting the Node Following a Given Node




1  If LOCP = NULL, then:

    Set START : = LINK[START].     [Deletes first node]

Else: 
       Set LINK[LOCP]  : = LINK[LOC].    [Delete node N.]

[End of structure .]

2.      [Return  deleted node to the AVAIL list.]

     Set LINK[LOC]  : = AVAIL and AVAIL : = LOC

3.  Exit
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Deleting the Node with a Given ITEM of Information




1.  [Use procedure FINDB to find the location of N and its preceding node.]

2.    If LOC  = NULL, then : write : ITEM not in list, and Exit.

3.  [Delete node.]

   If LOCP = NULL, then:
    Set START : = LINK[START].    [Delete first node]

Else :

   Set LINK[LOCP] : = LINK[LOC]

[End of structure]

4.  [Return deleted node to the AVAIL list.]
  Set LINK[LOC] : = AVAIL and AVAIL : = LOC.
5.    Exit.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Deleting the Node with a Given ITEM of Information




1.        [List empty?]  If START = NULL, then:
               Set   LOC: = NULL and LOCP : = NULL, and Return.
[End of If Structure.]

2.  [ITEM in first node?]    If  INFO[START] = ITEM, then:
        Set LOC : = START and LOCP = NULL, and Return.

[End of IF Structure]

3.   Set SAVE : = START and PTR : = LINK[START].     [Initialize Pointer]

4.   Repeat Steps 5 and 6 while PTR != NULL.

5.   If INFO[PTR] = ITEM, then:
     Set LOC : = PTR and LOCP : = SAVE , and Return.

[End of If Structure]

6.   Set SAVE : = PTR and PTR : = LINK[PTR].     [Update Pointer]

   [End of Step 4 loop]

7.   Set LOC : = NULL.      [Search Unsuccessful]

8.   Return.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE