February 2013 change
Welcome to Wikipedia. I noticed that you recently made a new article or made changes to one, for example "P versus NP", by adding things copied from a book, magazine, newspaper or another website without the permission of the copyright holder. Many sources, including websites found on the Internet, are copyrighted. I'm afraid Wikipedia cannot accept any things copied from these sources as it can get Wikipedia into serious legal trouble. The article or changes have been or will soon be deleted. Next time, look up sources to find out information for articles and explain it in your own words, and don't copy sentences or images from them. Thank you. Osiris (talk) 10:57, 10 February 2013 (UTC)
I am the author I made the changes you see below on the other page you prior deleted a <a href=3D"/wiki/Nondeterministic_Turing_machine" title=3D"Nondeterministic Turing machine" class=3D"mw- redirect">nondeterministic Turing machine</a>. A problem p in NP is also in NPC <a href=3D"/wiki/If_and_only_if" title=3D"If and only if">if and only if</a> every other problem in NP can be transformed into p in polynomial time. NP-complete can also be used as an adjective: problems in the class NP-complete are known as NP-complete
problems.
What follows is reduced source code:
// Copyright =C2=A9 2010 www.meami.org // // The information on
this page may not be reproduced or republished on another web page or
web site unless done so by M. M. Musatov (with the exception of
Wikipedia). // M. M. Musatov, Meami.org, release this code for private
non-profit non-commercial use only - All Other Rights Reserved. // //
include // #include // #include // #include // // using namespace
std; // // typedef struct node // { // int nElem; // struct node
- pNextNode; // }Node; // // // int pushElem(Node **argpRoot, int
argnElem) // { // Node *pNewNode; // pNewNode =3D (Node
- )malloc(sizeof(Node)); // if(!pNewNode) // { // fprintf(stderr,"\n\t
ERR: Memory allocation failure for Node \n"); // return -1; // } // //
pNewNode->nElem =3D argnElem; // pNewNode->pNextNode =3D NULL; //
if(*argpRoot=3D=3DNULL) // { // *argpRoot =3D pNewNode; // } // else // { /=
/
pNewNode->pNextNode =3D *argpRoot; // *argpRoot =3D pNewNode; // } //
return 1; // } // // // int popElem(Node **argpRoot) // { //
assert(*argpRoot!=3DNULL); // int nRetElem; // Node *pDeleteNode; //
pDeleteNode =3D *argpRoot; // *argpRoot =3D (*argpRoot)->pNextNode; //
nRetElem =3D pDeleteNode->nElem; // free(pDeleteNode); // return
nRetElem; // } // // void deleteList(Node **argpRoot) // { //
while(*argpRoot) // { // popElem(argpRoot); // } // } // // void
printElems(Node *argpRoot) // { // //assert(argpRoot !=3D NULL); //
if(argpRoot!=3DNULL) // { // Node *pTempNode =3D argpRoot; //
while(pTempNode->pNextNode) // { // fprintf(stdout,"%d-
>",pTempNode->nElem); // pTempNode =3D pTempNode-
>pNextNode; // } // fprintf(stdout,"%d",pTempNode-
>nElem); // } // } // // int findElemFromListEnd(Node *argpRoot,int
nTargetPos,int *argpnElem) // { // /* // assert(argpRoot!=3DNULL); //
assert(nTargetPos <=3D INT_MAX && nTargetPos > 0); //
assert(argpnElem!=3DNULL); // */ // // if(argpRoot =3D=3D NULL) // { //
fprintf(stderr, "\n\t ERR: list is empty\n"); // return -1; // } // //
if((nTargetPos > INT_MAX) || (nTargetPos <=3D 0)) // { //
fprintf(stderr, "\n\t ERR: target position should be <=3DINT_MAX and
non-zero positive value\n"); // return -1; // } // // if(argpnElem =3D=3D
NULL) // { // fprintf(stderr, "\n\t ERR: no memory allocated to store
the element at target position in the input list\n"); // return
-1; // } // // Node *pFwdNode,*pLagNode; // int nCurrentPos =3D 1; // //
pFwdNode =3D argpRoot; // pLagNode =3D NULL; // // while(pFwdNode) // { //
if(nCurrentPos =3D=3D nTargetPos) // { // pLagNode =3D argpRoot; //
break; // } // pFwdNode =3D pFwdNode->pNextNode; // nCurrentPos+
+; // } // // if(!pLagNode) // { // fprintf(stderr, "\n\t ERR: target
position specified is non-existent for the current list\n"); //
- argpnElem =3D -1; // return -1; // } // // while(pFwdNode-
>pNextNode) // { // pLagNode =3D pLagNode->pNextNode; // pFwdNode
=3D pFwdNode->pNextNode; // } // *argpnElem =3D pLagNode->nElem; //
return 1; // } // int main() // { // Node *pRoot =3D NULL; // int
nNumElems =3D 0; // int nCurElem; // unsigned int unTestCaseId; // int
nTargetPos; // int i; // // while(!feof(stdin)) // { //
fscanf(stdin,"---\n"); // fprintf(stdout,"---\n"); //
fscanf(stdin,"NumOfElems :%d\n",&nNumElems); //
fprintf(stdout,"NumOfElems :%d\n",nNumElems); //
fflush(stdout); // for(i=3D0;i // { //
fscanf(stdin,"%d,",&nCurElem); //
pushElem(&pRoot,nCurElem); // } // printElems(pRoot); //
fflush(stdout); // fscanf(stdin,"\nTarget Position :%d
\n",&nTargetPos); // fprintf(stdout,"\nTarget Position :%d
\n",nTargetPos); // fflush(stdout); //
if(findElemFromListEnd(pRoot,nTargetPos,&nCurElem)<0) // { //
fprintf(stdout,"ERROR\n"); // // } // else // { //
fprintf(stdout,"Element:%d\n",nCurElem); // } // fscanf(stdin,"---
\n"); // fprintf(stdout,"---\n"); // fflush(stdout); // //
deleteList(&pRoot); // } // return 0; // }<a href=3D"http://
meami.org/gibraltar.htm" class=3D"external autonumber"
rel=3D"nofollow">[1]</a>
NP-complete problems are studied because the ability to quickly verify solutions to a problem (NP) seems to correlate with the ability to quickly solve that problem (<a href=3D"/wiki/P_(complexity)" title=3D"P (complexity)">P</a>).
- Hello. You have a new message at Osiris's talk page. Osiris (talk) 11:31, 10 February 2013 (UTC)
This is the discussion page for a person who has not created an account yet, or who does not use it. We have to use the numerical IP address to identify them. An IP address can be shared by many people. If you feel that things said here are not about you, you can create an account or log in to stop it happening again. |