Skip to content

Grimoors/IIITH_DSA_T2_Y1_2021_ProjectRepo_Team36_MiniProject1

Repository files navigation

IIITH_DSA_T2_Y1_2021_ProjectRepo_Team36_MiniProject1

ReadMe File.


We add data for the Program here.

Documentation

//amey's part

We start off in the main function by declaring a var num_nodes, for number of nodes. We ask for input from the user and initialise num_nodes with that value.

We then declare a var ParentArr of type struct PtrNode,which is an array of num_nodes cells . We allocate it sufficient memory so we can store the values.

Using a for loop,we first initialise it to NULL for all cells of the array.

We now use the Initialise_Tree function to initialise the tree,making nodes one after another based on the input.

We declare a var P of type struct PtrHeap and we initialise it using the Initialise_Heap function. We then give it as a pointer to P.

We then declare a var search_method of type char,which we take as input string to check the traversal.

We declare and initialise a global array for storing various parameters.

We declare an int seentime and initialise it to 0. We will use this to determine the number of times a node is traversed. We assign the value of int seentime to the pointer of the seen_time of struct ParentArr[0]. We then increment it.

We use HeapInsert function which inserts new nodes to the heap and then balancing the heap after each entry.

Next,a for loop is used to initialise sumdepth of array for all elements.

We declare and initialise an int j = 1.

Using a while loop, with condition of function IsEmpty(P) not being 0. We do a bunch of assigning operations for array[j] and increment j. The loop doesnt end there.

Within the loop , we declare and initialise an int i = 0. We use a second while loop with the condition of int i being less than ParentArr[value - 1]->num_children. We /////////////Help here///////

The aforementioned outer and inner loops end.

As good programmers, we deallocate the memory allocated to Heap array,the Heap itself and to the parent array using the free() function.

Work Allocation



Serial No Team Member Work Allocated Github Profile
1 Vivek Mathur Depth First Search(Comparator and Algo), Code merging,
Data Analysis lead and writer
LINK
2 Karthick Ashwath Documentation LINK
3 Abhishek Sharma Greedy Search (Algo and Code), Breadth First Search (Algo and code), Code merging LINK
4 Amey Kunte Documentation LINK
5 Keerthana K. Greedy Search (Algorithm) , Iterative deepening depth-first search (Algorithm) LINK


Timeline

LOG->

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Entry 1 -> --> Entry by Vivek Mathur

Actions Taken

(in Individual folder)
Added Basic files, Restructured into Standard Form, Added a main.c and A Way to input into Tree.
Added the find Parent and insert function, It is currently recursive, thinking of ways to make it iterative.


Planning to add a print function for to test the Input function.

Documentation :__

The Data Structure that WE are Using initally --> As of 26/04/12


                                   Data (Graph) Strcuture
                                    
                                    Tree - General, 

                                    node Root;

                                    --------
                                   |  Node  | <---- Root Node
                                    --------
                                        |
                                        |
        ________________________________|____________________________    .........___________.............. 10000 terms
       |                                   |                                          |
       |                                   |                                          |
     
     Pointer                            Pointer                                     Pointer
  Root->children[0]                 Root->children[1]                           Root->children[i]
       
       
    --------                            --------  
   |  Node  | <----Child Node [0]      |  Node  | <----Child Node [1]     .......... NULL   .......... 
    --------                            --------
    
        |                                  |
        |                                  |
        |                                  |
       ...                                ...

There are other Stubs associated with each root : Namely :-

int depth, seen_time, number_of_children;

int state_number;     //  "NAME" of a node<br>
int value;            //    Data of graph, Used by comparator<br>
int parent;           //    Holds the name of the "Parent"<br>

// We shall remove the 'i' in the main .c and node.h soon.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

About

Team 36 - The Project on "Trees, and their sorting algorithms"

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages