Guest User

Untitled

a guest
Sep 24th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. void pagina2::CalcPR(nodo *pagina, int cant) {
  2.  
  3. if (cant < 1) {
  4. return;
  5. }
  6.  
  7. nodo *tempN;
  8. arista * tempA;
  9. double tempPR;
  10. tempPR = pagina->pr;
  11. tempN = pagina;
  12.  
  13. nodo * temp2;
  14. temp2 = tempN->sig;
  15.  
  16.  
  17. while (tempN != 0) {
  18. while (temp2 != 0) {
  19. if (tempN->usado && tempN != temp2) {
  20. tempA = temp2->adyc;
  21. while (tempA != NULL) {
  22. if (tempA->nombre == tempN->nombre) {
  23. if (temp2->bl == 0)
  24. getNodo(tempA->nombre)->pr = 0;
  25.  
  26. tempPR += getNodo(tempA->nombre)->pr / temp2->bl;
  27. }
  28. tempA = tempA->sig;
  29. }
  30. }
  31. else {
  32. if (tempN == temp2)
  33. temp2 = temp2->sig;
  34.  
  35. if (!tempN->usado)
  36. tempN->sig;
  37. }
  38.  
  39. temp2 = temp2->sig; //Here's where I get the error "Exception thrown: read access violation. temp2 was nullptr."
  40.  
  41. }
  42.  
  43. tempN->pr = (1 - d) + d * tempPR;
  44.  
  45. tempN = tempN->sig;
  46. temp2 = pagina;
  47. }
  48.  
  49. CalcPR(primeroN, cant--);
  50.  
  51. return;
  52. }
  53.  
  54. CalcPR(primeroN, cant--);
Add Comment
Please, Sign In to add comment