Search:

Type: Posts; User: satty

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    7,641

    thanks.... I worked it out. But I have a...

    thanks....
    I worked it out.

    But I have a function that gives me the intersection of 2 vectors. But I dont know the return types of this function.
    I want to pass the value returned by the...
  2. Replies
    8
    Views
    7,641

    in this particular case, if 5 is not in the first...

    in this particular case, if 5 is not in the first column then make it the first entry and the associated value the secon

    the the file will look like
    1 4
    2 3
    3 2
    4 5

    1 4
    2 3
  3. Replies
    8
    Views
    7,641

    I am able to read my file using the vectors as ...

    I am able to read my file using the vectors as


    vector<int> v1;
    vector<int> v2;
    vector<int> v(30);
    vector<int>::iterator it;
    fp = fopen("10_1.txt","r"); ...
  4. Replies
    8
    Views
    7,641

    Reading a text file to a vector

    Hello!
    I wanted to use vectors to read my input text file.
    I dont know what is going wrong in the code.
    Can anyone comment?
    thanks


    #include <stdio.h>
    #include <stdlib.h>
    #include...
  5. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    Hello! Thanks a lot andruli .I sorted it out n...

    Hello!
    Thanks a lot andruli .I sorted it out n it worked.
    thanks again :)
  6. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    Thanks for all the help till now. I am almost...

    Thanks for all the help till now.
    I am almost through the code. (no warnings/ no errors)

    But i got stops at
    if (goal == queue->info )
    while my my delete and insert queue function fine too.......
  7. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    hey! This is the recent improvement i made. ...

    hey! This is the recent improvement i made.

    When i compile I get the following errors:
    A.c: In function 'Insert_Queue':
    A.c: warning: assignment makes integer from pointer without a cast
    A.c:...
  8. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    My find function should give the adjacent nodes...

    My find function should give the adjacent nodes for the start nodes.
    like


    struct mainList *find_node( int value)
    {
    struct mainList *ptr = *pHead;
    struct adjList *ptr2 = NULL;
    ...
  9. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    struct mainList *find_node( int value) { ...

    struct mainList *find_node( int value)
    {
    struct mainList *ptr = *pHead;

    while(ptr != NULL)
    {
    if(value == ptr->nodeNum)
    {
    printf("The starting node is : %d \n",...
  10. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    Hey andruli, It was a segmentation error that i...

    Hey andruli,
    It was a segmentation error that i fixed but I think my find node function is not working . I was using the pseudo code u helped with.
    This function finds the node that has value...
  11. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    Ya I checked.... I wanted to know if my code...

    Ya I checked....
    I wanted to know if my code line
    if ( goal == search1->nodeNum)

    is incorrect...coz m getting error when i try to run my program
    thanks
  12. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    thanks i did that n found that I have an error in...

    thanks i did that n found that I have an error in my delete function.
    when i free one of the values.
    but why so, i dont understand........can some1 comment?



    struct Q * Delete_Queue(struct...
  13. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    hello! My program compiles but i get an error...

    hello!
    My program compiles but i get an error like
    per(1711) malloc: *** error for object 0x100300670: pointer being freed was not allocated
    *** set a breakpoint in malloc_error_break to debug...
  14. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    Hello anduril462 .Thanks a lot till now. I tried...

    Hello anduril462 .Thanks a lot till now. I tried the above template to implement in my code but something is really messing up things.

    Firstly I have initialized a member in mainList called int...
  15. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    Sure! I tried using Flag thingi but I did it well...

    Sure! I tried using Flag thingi but I did it well from wahtever I read n all

    the strucutres that I am using for main list and adjacecny list are


    // Adjacency List Structure



    struct...
  16. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    hey! I am doing something like this I made a...

    hey!
    I am doing something like this
    I made a structure and queues : to insert ans delete


    struct Q
    {
    int info;
    struct Q *next;
    };
  17. Replies
    3
    Views
    3,044

    Hey! Firstly you need to allocate memory for...

    Hey!
    Firstly you need to allocate memory for the values. And this is bot the right way to work with with 2 dimensional arrays.

    Read Dynamic allocation of memory!
    something like

    Something...
  18. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    hello! I tried something like this and it...

    hello!
    I tried something like this and it worked but i guess it is not an appropriate way to go



    void SearchAndPrintList(int value, int value2)
    {

    int i;
    //int array = malloc(20)
  19. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    i did something like this but it keeps on adding...

    i did something like this but it keeps on adding the node till segmentation fault.


    void SearchAndPrintList(int value, int value2)
    {
    struct mainList *ptr = *pHead;
    struct adjList *ptr2 =...
  20. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    only the last issue. I have trying to print...

    only the last issue.

    I have trying to print the adjacent nodes on a user input node value.


    void SearchAndPrintList(int value)
    {
    struct mainList *ptr = *pHead;
    struct adjList *ptr2 =...
  21. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    Thanks a ton. i got it and it worked perfectly...

    Thanks a ton.
    i got it and it worked perfectly nice.
    This forum is awesome :)
  22. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    hey thanks, I used sscanf...it was easy n...

    hey thanks, I used sscanf...it was easy n convinent.

    I could make the adajceny list...
    but got another error in my print function i guess.
    I gives me two values now like

    123 -> 111 0.000000 ...
  23. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    hey ! I figured out it wont work for me become I...

    hey !
    I figured out it wont work for me become I have different functions that make adjacency list.
    But
    when i parse the lines...
    it goes till the end of the line while(*line != '\0')

    and...
  24. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    thanks all. let me try that.

    thanks all.
    let me try that.
  25. Thread: adjacency list

    by satty
    Replies
    41
    Views
    8,650

    i don't think that makes much different because I...

    i don't think that makes much different because I have latter written parsing codes for all three columns. First column act as main list and other two ad as the adjacency list.

    but something went...
Results 1 to 25 of 97
Page 1 of 4 1 2 3 4