Пример #1
0
void freeTrie(node* tree){
	int i;
	for(i=0; i<TOTAL_CHARS; i++){
	if(tree->link[i] != NULL)
		freeTrie(tree->link[i]);
	}
	free(tree);
}
Пример #2
0
void freeTrie(Tree *dic) {
    Tree current = *dic;
    for(int a = 0; current -> children[a]; a++) {
        freeTrie(&current -> children[a]);
    }
    free(current -> childChar);
    free(current -> children);
    free(current);
}
Пример #3
0
/**
 * Deallocates (recursively) all memory used by a trie.
 */
static void freeTrie(TrieNode* node)
{
	int c;
	if(node != NULL) {
		for(c = 0; c < N_TRIE_CHILDREN; c++) {
			freeTrie(node->children[c]);
		}
		free(node);
	}
}
Пример #4
0
void freeTrie(struct TrieNode **ppRoot){
  struct TrieNode *pRoot;
	
  if (ppRoot == NULL) return;
	
  /* Step pointer down */
  pRoot = *ppRoot;
  if (pRoot == NULL) return;
	
  /* Free child nodes */
  freeTrie(&(pRoot->a));
  freeTrie(&(pRoot->c));
  freeTrie(&(pRoot->g));
  freeTrie(&(pRoot->t));
	
  /* Free leaf */
  if (pRoot->pLeaf != NULL) free(pRoot->pLeaf);
	
  /* Reset original pointer */
  *ppRoot = NULL;
}
Пример #5
0
void encode () {
    codeCount = 1;
    Tree codeTrie;
    createT(&codeTrie);
    if (!Escaped){
        initializeTrie(&codeTrie);
    }
    int firstChar = getchar();
    while (firstChar != EOF) {
        firstChar = getLargestSequence(firstChar, &codeTrie);
    }
    freeTrie(&codeTrie);
}
Пример #6
0
int main(){
	char *s[] = {"Band", "Bandwidth", "Navneet Kaur Chopra","Sarbrinder Singh","A K Khanna","Aagesh Sharma","Aashima Gupta","Aashima Madaan","Aayush Sharma","Abhay Goyal","Abhay Shah","Abheek Bansal","Abhijeet Prakash","Abhilasha Gupta","Abhimanyu Sharma","Abhimanyu Wadhera","Abhinandan","Abhinav Garg","Abhinav Gupta","Abhinav Gupta","Abhinav Jain","Abhinav Puri","Abhineet Munshi","Abhishek","Abhishek Choudhary","Abhishek Tayal","Abhishek Tomar","Abhishek Upadhyaya","Abhivishrut Vishnoi","Abishek Thakur","Achal Gupta","Achin Maheshwari","Adarsh Kumar","Adarshpal Singh Phull","Adesh Gupta","Adhidesh S. Kumawat","Adit Chauhan","Aditi Wadhwa","Aditya Arora","Aditya Kalia","Aditya Kashyap","Aditya Sharma","Aditya Singla","Aditya Soni","Agya Pal Singh","Air Vice Marshal SK Jindal (retd)","Ajay Aneja","Ajay Grover","Ajay Jolly","Ajay kachru","Ajay Kumar","Ajay Kumar","Ajay Kumar","Ajay Kumar Jolly","Ajay Mahajan","Ajay Pal","Ajay Pal","Ajay Sharma","Ajaydeep Singh Romana","Ajaypal Singh","Ajit Masand","Ajit Singh","Ajit Singh Thandi","Akchitta","Akesh Khandelwal","Akhil Gupta ","Akhil Tandon","Akshay Bhatia","Akshay Kalia","Akshita Jain","Alka Jindal","Aman Gupta","Aman Mohan","Amandeep Dhillon","Amandeep Garg","Amandeep Kaur","Amandeep Singh","Amandeep Singh","Amandeep Singh","Amandeep Singh Gill","Amanjot Kaur","Amanpreet Kaur","Amanpreet Singh","amardip kumar","Amardip Kumar","Amarinder Singh","Amarjit Singh Kohli","Ambika Kapoor","Amil Bansal","Amit ","Amit  Kumar Bansal","Amit Bansal","Amit Grover","Amit Gupta","Amit Kumar","Amit Mittal","Amit Singal","Amit Singh","Amit Singla","Amit Soni","Amneet Singh Bedi","Amod","Amol Aggarwal","Amrinder Singh","Amrinder Singh Chhina","Amrit Batra","Amrit Goyal","Amrita Bhatia","Amritpal Singh","AN Chowdhry","Anant Modwal","Anchal Ghai","Anchal Singhal","Angad Arora","Anil Chalana","Anil Chaudhry","Anil Chaudhry","Anil Chawla","Anil Goel","Anil Goyal","Anil Kumar Batta","Anil Kumar Chowdhri","Anil Kumar Goswami","Anil Mittal","Anil Sharma","Anil Sondhi","Anirudh ","Anirudh Koul","Anish","Anish Goyal","Anjali Gupta","Ankit Agrawal","Ankit Gupta","Ankit Gupta","Ankit Jain","Ankit Jindal","Ankit Manchanda","Ankit Manocha","Ankit Singhal","Ankit Tyagi","Ankit Uppal","Ankur","Ankur Goyal","Ankur Gupta","Ankur Khanna","Ankush Kanwar","Anmol rattan Singh","Anshu Bansal","Anshul Bansal","Anshul Garg","Anshul Gupta","Anshul Jindal","Antara Saha","Anu Bala","Anu Verma","Anuj Kumar","Anuj Mathur","Anukul Singh Mohan","Anupam","Anupam","Anupam","Anupam Mittal","Anupam Sharma","Anurag Loach","Anurag Sodhi","Apurv Jain","Aradhana ","Archit Mathur","Ariganjan S Guleria","Arijit Chatterjee","Arinjay Jain","Arjun Prashant Venkataraman","Arjun Singh Gill","Arjun Srivastava","Arjun Swarup","Arneet Singh Sarna","Arpanjit Kaur","Arun","Arun Mahajan","Arun Rathi","Arun Sharma","Arvind Bansal","Arvind Bhutani","Arvind Prashar","Aseem Agarwal","Aseem Gaurav","Aseem Mittal","Aseem Monga","Aseem Rambani","Asha Gupta","Ashish","Ashish","Ashish Aggarwal","Ashish Aggarwal","Ashish Bagga","Ashish Choudhary","Ashish Narang","Ashish Sharma","Ashish Singla","Ashish Sood","Ashok Grover","Ashok Grover","Ashok Kr.Dhiman","Ashok Kumar","Ashok Motwani","Ashutosh Arun","Ashutosh Mangla","Ashwani Chaswal","Ashwani Godara","Ashwani K Sethi","Ashwani Kansal","Ashwani Salwan","Atishay Jain","Atul Arora","Avan Goel","Avinash Chander Mannan","Avinash Kaur","Aviral Chauhan","B.S.Pari","Bafpalbir Singh","Balbir Singh","Baldip Singh Kohli","Baljeet Singh","Baljinder S. Saggu","Balvinder Singh","Barat Gupta","Barinder Singh","Basant Kumar Midha","Bhabi Bhatia","Bhajan Singh","Bharat Bhushan Grover","Bhavna Singal","Bhupinder Singh","Bikramjeet Singh Attly","Bikran Singla","Bindu","Bittu Kumar Singh","Briendra Maunder","Brij Lal","C.K.Gupta","CaptainIN Jitendra Kumar Sharma (Retd)","CDR.  Ravinder Pal Singh Josen","Chamandeep Sehgal","Chandan Bansal","Chandan Lal","Chandanpreet Singh","Chander Bhushan Goel","Chandra Prakash","Charanpreet Singh","Charu Bassi","Chetan Arora","Chetan Mehta","Chetan Sharma","Chirag Juneja","Chirag Madaan","Chitrakshi Goel","D S Brar","Damanjeet","Damanjit Singh","Damanpreet Singh","Darashpreet Singh","Davinder Saini","Davinder Singh Saini","Davinder Wadehra","Deepak Garg","Deepak Goyal","Deepak Goyal","Deepak Goyal","Deepak Jindal","Deepak Kapur","Deepak Midh","Deepak Mittal","Deepak Mittal","Deepak Parma","Deepak Sharma","Deepak Sharma","Deepak Singh","Deepika Goel","Defi Bansal","Des Raj Kalra","Devabrata Ray","Devan","Devendra Kumar Sharma","Devesh Wadhwa","Devinder Singh","Devinder Singh Sengar","Dhanwant Singh Kang","Dharminder Chanana","Dharminder Kaur","Dheeraj Singla","Dhiraj M Kaushal","Dhruv Kalia","Dhruv Malhotra","Dilip Kuchipudi","Dinesh Jain","Dinesh Mehta","Disha Gupta","Divesh Kumar Kamboj","Divneet Singh Kapoor","Divya Kukreja Girdhar","DK Kakkar","DPS Kharbanda","Dr. InderPreet Singh Ahuja","DR. Raj Sodhi","Dr. Rajeevan Chandel","Dushyant Barara","Er Seema Garg","G.C.Sharma","Gagan Gupta","Gagandeep Kaur","Gagandeep Sharma","Gagandeep Singh","Gagandeep Singh","Gagandeep Singh","Gagandeep Singh Bhatti","Gagandeep Singh Sehgal","Gaurav  jindal","Gaurav Bansal","Gaurav Banyal","Gaurav Beniwal","Gaurav Dhull","Gaurav Jain","Gaurav Jhamra","Gaurav Jindal","Gaurav Karkara","Gaurav Nagpal","Gaurav Preet Singh","Gaurav Randhawa","Gaurav Sharma","Gaurav Singla","Gaurav Singla","Gautam Jain","Gautam Luthra","Gazal Singla","Geeta Ahuja","Ghansham","Girdhari Lal Garg","Gobind SinghMaini","Gopal Kapur","Gourav","Gourav Garg","Gourav Gupta","Gourav Sachdeva","Gulveen Nerhan","Guneet Singh Sodhi","Guninder Sharma","Gurbachan Singh Chhabra","Gurdeep Kaur","Gurdeep Singh","Gurdeep Singh Lubana","Gurinder Raj Singh","Gurjit Singh Malhi","Gurjot","Gurjot Singh Dhaliwal","Gurjot Singh Dhillon","Gurjyot Singh","Gurkiran Budhail","Gurleen Kaur","Gurleen Singh Ruprah","Gurmeet Singh","Gurnoor Singh","Gurpal Singh Maan","Gurpreet Singh","Gurpreet Singh","Gurpreet Singh","Gurpreet Singh Basra","Gurpreet Singh Bedi","Gurpreet Singh Sahu","Gurpreet Singh Walia","Gursewak Singh Saggu","Gurtej Singh","Gurtej Singh Garewal","H.S.Kalra","Hament","Hamon Gupta","Happy Mittal","Harbans Lal garg","Harbir singh","Hardeep Singh","Hardeep Singh Rai","Hari Vansh Gupta","Harinder Singh","Harinder Singh","Harinder Singh Dhanoa","Harish Gupta","Harjot","Harjot Singh Sandhu","Harkamwaljeet Singh Kataria","Harman Preet Singh Batra","Harmandeep Singh","Harmandeep Singh","Harmandeep Singh","Harmeet Singh","Harminder Singh","Harminder Singh","Harnarinder Singh Panesar","Harpreet Kaur Bindra","Harpreet Singh","Harpreet Singh","Harpreet Singh","Harpreet Singh","Harpreet Singh","Harpuneet Dhaliwal","Harsh Dhaka","Harsh Jain","Harsh Wardhan","Harshal Chawla","Harsheel Kaur","Harshit Aggarwal","Harshita Verma","Harsimran Singh Dhami","Harsimran Singh Sahni","Harvinder Saini","Heaven Singh","Hemant Aggarwal","Hemant Brar","Hemant Majithia","Himani Jain","Himanshu","Himanshu Anand","Himanshu Arora","Himanshu Bassi","Himanshu Chadha","Himanshu Jindal","Himanshu Kumar","Himanshu Samolia","Hiten","Hitesh Jain","Hitesh Kumar","Hitesh singla","Hitesh Wadhwa","Hitu Madaan","Honey Grover","Honey Sharma","Hunish Bansal","Ibbadat Kaur","Ikwinder Singh Chadha","Inderjit Bhatia","Inderpreet","Iqbal Sidhu","Ishan Jand","Ishan Kaushal","Ishank Narula","Ishvdeep Singh Shokar","J K Wadhwan","J M Khanna","Jagandeep Singh","Jagatbir Singh Saluja","Jagdeep","Jagdeep Singh","Jagdeep singh","Jagdish Saggar","Jagjit Singh Gope","Jagpal Singh Ubhi","Jainoop Singh Bal","Jas Kanwaldeep Singh","Jasbir Singh","Jasbir Singh Ahlawat","Jasbir Singh Jassi","Jashanjeet Randhawa","Jasjeet Singh","Jasmeen Kaur","Jasmeet S Malik","Jasmeet Singh","Jaspal (Paul) S. Gill","Jaspal Garg","Jaspal Singh","Jaspal Singh","Jaspal Singh","Jaspal Singh","jaspal singh jabbi","Jaspinder Singh","Jaspreet","Jaspreet singh","Jaspreet Singh Khiva","Jaspreet Singh Khiva","Jasvir Singh","Jatin Gupta","Jatin Sharma","Jatinder Pal Singh Trehan","Jayesh Nagpal","Jigmey Namgyal","Jishant Santoshi","Jitesh Kumar","Jitin Gupta","Jiwan Goyal","JP Sing","Jyoti Bains","Kailash","Kalyan Parkash Puri","Kamaldeep Singh","Kanav Kalia","Kanishk Puri","Kanupriya Aggarwal","Kanwal Preet Singh","Kanwar Inder Singh Sandhu","Kanwar Pal Singh","Kanwardeep Singh","Kanwarnihal Singh Gill","kapil agrawal","Karamjit Singh Sidhu","Karan Bhasin","Karan Chhabra","Karan Chugh","Karan Goyal","Karan Mittal","Karanveer","Karanveer Singh Sodhi","Karun Jain","Kawaldeep Singh ","Kawalpreet Singh","khushank","Kiran Jeet","Kirti Gupta","Kishy Kumar","Komal Saluja","Krishan Kant","Krishan Kumar Agrawal","Krishan Kumar Kansotia","Krishna Chaitanya","Kulbhushan","Kulbhushan Gupta","Kulbir Singh Sheoran","Kuldeep Kumar Razdan","Kulpreet Singh","Kumar Kant Sharma","Kushagra Kapoor","Kushal Bansal","L R Bansal","Lakhmeer Singh","Lakhvinder Singh","Lakhvir Singh","Lakshay Arora","Lalit Khanna","Lalit Kumar","Lalit Kumar Gangwar ","Lalit Singla","Lokesh Agarwal","Loveneesh Garg","Lovleen Garg","Madan Lal","Madan Mohan Gupta","Madhav Agarwal","Madhu Aneja","Madhu Ra Kumar","Madhur Arora","Mahesh Chander Saini","Mahima Aggarwal","Makkhan Singh","Manas","Manas Goyal","Manav Gupta","Manav Malhotra","Manbir Kaur","Mandeep Batolar","Mandeep Singh","Maneesh Singal","Mangal Singh Rai","Mani Garg","Maninder Nirmann","Maninder Pal Singh","Maninder Singh","Maninder Singh","Maninder Singh","Manish Bahety","Manish Bansal","Manish Goyal","Manish Jindal","Manish Kumar Mawatwal","Manish Kumar Mawatwal","Manish Misra","Manish Tahiliani","Manjit singh","Manjot Singh Cheema","Manjot Singh Chhabra","Manmeet Bedi","Manmeet Singh","Manmohan Passey","Manmohit Singh","Manoj Kumar Khurana","Manpreet Singh","Manpreet Singh","Manpreet Singh Bhatti","Manu Aggarwal","Manu Mittal","Mayank Grover","Mayank Gupta","Mayank Mishra","Mayank Singh","Mayank Thamman","Mayuri Baid","Meenu Sharma","Megha Bangar","Mera Sahib","Misha Singhal","Mitav Kulshrestha","Mitindar Sethi","Mitindar Singh Sethi","Mittali Rustagi","Mohan Lal Bidani","Mohan Puri","Mohd Ishfaq","Mohinder Singh","Mohinder Singh Gaba","Mohit Garg","Mohit Geat","Mohit Goel","Mohit Goel","Mohit Goyal","Mohit Goyal","Mohit Goyal","Mohit Gupta","Mohit Kaura","Mohit Khurana","Mohit Kumar","Mohit Thakur","Monika Gupta","Mudit","Mudit Varshney","Muhammad Yunus ","Mukat Jain","Mukul Kalra","Mukul Suri","Mukund Kumar","Mukund Kumar","Munish Gupta","Munish Kalra","Munish kumar","Munish Kumar","Munish Rattanpal","Munish Vashishat","Murari Lal","Muzahid Hussain","N D Arora","N K Gupta","Nagendra Pratap Singh","Nagpal Tejinder Pal Singh","Nakul","Nancy Mehta","Nand Lal","Naomi Chopra","Naresh Dutta","Naresh Sood","Naresh Sood","Narinder","Narinder Kumar Gupta","Naval ","Navdeep Singh","Naveen Ahuja","Naveen Garg","Naveen Gupta","Naveet Kaur","Naveet Kaur","Navjot Kaur","Navjot Singh","Navjot Singh","Navjot Singh Waraich","Nawal Preet Singh","Neeraj","Neeraj Abbet","Neeraj Bansal","Neeraj Gupta","Neeraj Kataria","Neeru Gupta","Neha Aggarwal","Neha Goel","Neha Gupta","Neha Rastogi","Neha Rastogi","Neha Sood","Neha Wadhwa","Nikhil Aggarwal","Nikhil Handu","Nikhil Kumar","Nikhita Aggarwal","Nipun Goyal","Nischal Bansal","Nischal bansal","Nishan Singh","Nishant","Nishant Aggarwal","Nishant Negi","Nishant sharma","Nishant Yadav","Nisheeth Srivastava","Nitant Kaushal","Nitesh Bansal","Nitika Saini","Nitin","Nitin Aggarwal","Nitin Berry","Nitin Goyal","Nitin Gupta","Nitin Makhija","Nitin Sharma","Nitish","Nitish Chawla","Nitish Mahajan","Nitish Wadhwa","Niyati Sareen","NN Yadav","Noor Khan","Onkar Singh","Pankaj Bansal","Pankaj Garg","Pankaj Goyal","Pankaj Kumar","Pankaj Kumar","Pankaj Kumar","Pankaj Malhotra","Pankaj Thakur","Parag Aneja","Parag Arora","Paramjeet Singh Matharu","Paramjit Singh","Pardeep Jain","Pardeep Kumar","Pardeep Kumar Garg","Parikshat Sharma","Paritosh jain","Parminder","Parminder pal Singh Sandhu","Parminder Singh","Parmod  Sabberwal","Parmod Kumar Singla","Partap Singh  Sabharwal","Parti Karan Deep","Parul Goyal","Parveen Gandhi","Parveen Khanna","Pawan","Pawan Kumar Mehata","Pawandeep Singh","PawanKumarGupta","Piyush Dewan","Piyush Gupta","Piyush Jain","Piyush Jindal","Piyush Markan","PPS Gumber","Prabhdeep Singh Sidhu","Prachi Goyal","Prachi Gupta","Pradeep Kumar","Pradeep Kumar Goel","Pradeep Kumar Jain","Pradeep Teotia","Pragya Tikku","Prahlad Bhagat","Pramod Pandey","Pranav Gupta","Pranay Khanna","Pranay Soni","Pranjal Bhatia","Prashant Goyal","Prashant Khandelwal","Prashant Saraswat","Prashant Singh","Prateek Garg","Prateek Sikka","Praveen Aggarwal","Preet","Preet Inder Singh Nagi","Preet Joban Singh Sidhu","Preet Mohinder Singh Bajaj","Preetinder","Preetinder","Preetinder Verma","Preety Singh","Prem Kapoor","Prikshit Bhanot","Prith Pal Singh","Priya Mahajan","Priya Sapra","Priya Singla","Priya singla","Priyanka Jain","Priyanka Singh","Priyvrat Shringi","PS Matharu","Pukhraj Singh","Pulkit  Goel","Puneet","Puneet","Puneet Dua","Puneet Jindal","Puneet Jolly","Puneet Randhawa","Puneet Singh Brar","Puneet Surindernath Sarin","Punit Bhardwaj","R P Singh  Josen","R.K.Garg","R.M.Aggarwal","R.M.Jolly","Rachit jaggi","Rachit Khandelwal","Rachita Jain","Radheshyam","Radhika","Radhika Kakkar","Radhika Kaushik","Raghav Aggarwal","Raghvendra Prasad Agarwal","Rahul Bansal","Rahul Goel","Rahul gupta","Rahul Gupta","Rahul Jitla","Rahul Kumar","Rahul Malhotra","Rahul Mantri","Rahul Ohri","Rahul Pahwa","Rahul Sankhla","Rahul Thakur","Rajan Garg","Rajan Garg","Rajan Gauba","Rajan Mittal","Rajan Sharma","Rajat  Jindal","Rajat Gupta","Rajat Jain","Rajat Kapoor","Rajat Kohli","Rajat Mehta","Rajeev Bansal","Rajeev Chawla","Rajeev Garg","Rajeev K Goyal","Rajeev Sehgal","Rajeev Sharda","Rajendra Mohan Aggarwal","Rajesh ","Rajesh Dua","Rajesh Dubey","Rajesh Garg","Rajesh Kumar","Rajesh Kumar Goyal","Rajesh Sharma","Rajinder Gupta","Rajinder Jakhu","Rajinder Kumar Chadha","Rajinder Singh","Rajit Goyal","Rajiv Aggarwal","Rajiv Gandotra","Rajneesh Chugh","Rajni","Rajnish Behl","Rakesh (Gupta)  Dhablania","Rakesh Amba","Rakesh Bhatnagar","Rakesh gupta","Rakesh K Babbar","Rakesh K. Manocha","Rakesh Kumar","Rakesh Kumar","Rakesh Kumar Mehta","Rakind","Rakshit Jain","Ram Narayan Malik","Ram Partap Singhal","Raman Kundal","Ramandeep Goyal","Ramandeep Singh Lamba","Ramandeep Singh Manaise","Rameena Chhuneja","Ramesh Goel","Randeep Bhatia","Randhir Singh","Ranjiv Jain","Ranjot Singh","Rashik","Rashik Bansal","Rashmi Rani","Ravi Ranjan","Ravi Sunder","Ravinder Kumar Duvedi","Ravinder Paul Bector","Ravneet Ahluwalia","Ravneet Kaur Grewal","Renu Khanna","Reshu","Richa","Richa","Richa Aggarwal","Richu Kakkar","Rimaljit Kaur","Rineet Dheendsa","Ripan","Rishabh Dhingra","Rishabh Kharwal","Rishemjit Kaur","Ritika","Ritika Gupta","Robin Bains","Robin Bansal","Robin Dhingra","Rohan Khanna","Rohan Khera","Rohit","Rohit Chawla","Rohit Dhawan","Rohit Garg","Rohit Goel","Rohit Jain","Rohit Jindal","Rohit Jindal","Rohit kumar","Rohit Singla","Rohit Sood","Rohit Vij","Rohtash","Romesh Chand Singhal","Romil","Romila Raina","Roopam Bhutani","Rosy Chhabra","Ruchika Juneja","Ruchika Mittal","Rumit","Rupal Jindal","Rupesh Garg","Rupinder Kaur Saini","Rupinder Singh","S K Bansal","S K Huria","S. C. Verma","S.K.Punj","S.M.Mittal","Sachin","Sachin","Sachin Goyal","Sahil Aggarwal","Sahil Chhapola","Sahil Garg","Sahil Garg","Sahil Garg","Sahil Grover ","Sahil Gupta","Sahil Jain","Sahil jain","Sahil Sachdeva","Sajal Nagwanshi","Saket Bhatia","Sakshi mehra","Sakshi Sharma","Saloni Gupta","Samardeep Singh","Sameer Bansal","Sameer Jain","Sameer Luthra","Samit Rolha","Sanchika Gupta","Sanchit Arora","Sandeep Dewett","Sandeep Jain","Sandeep Kalia","Sandeep Pahuja","Sandeep Puri","Sandeep Sareen","Sandeep Singh","Sandeep Singla","Sandeep Sony","Sanjay Batish","Sanjay Garg","Sanjay Jain","Sanjay Madan","Sanjay Tandon","Sanjeev kakran","Sanjeev Kumar","Sanjeev Kumar Goyal","Sanjeev Kumar Sharma","Sanjeev Ratti","Sanjeev Wangoo","Sarabjit Singh","Sarabjit Singh","Saral Jain","Saranjit Singh","Saranjit Singh","Sarv Krishan Punj","Sarv Krishan Punj","Sarvesh Jain","Satinder Kaur (Sherry Dayal)","Satinder kumar Bhalla","Satish Gupta","Satish K Dua","Satish Kumar Sharma","Satish Kumar Vij","Satpal singh","Satpal Singh","Satyajeet Singh","Saurabh Aggarwal","Saurabh Agrawal","Saurabh Gupta","Saurabh Munjal","Saurabh Tandon","Saurav Bansal","Savit Pannu","Savleen Kaur","Sehej Buttar","Shahul Bains","Shaillesh Aggarwal","Shakun Grover","Sham Sunder Puri","Shammi Bains","Sharanjeet","Sharanjeet Singh","Shashank","Shashank Aggarwal","Shatrughan Modi","Shaunak","Sheela Tiwari ","Shellja Bansal","Sherry","Sherry Sethi","Shiffia Mittal","Shilpa Bansal","Shivam","Shivdeep Brar","Shivditt singh","Shobit Bansal","Shray Jali","Shruti Malik","Shruti Singhal","Shubham Singh","Shubpreet kaur","Shuchi Kapoor","Shuchi Kiran","Shveta Sharma ","Shweta Chadha","Siddharth Astir","Siddharth Gupta","Siddharth Joshi","Siddharth Rojha","Sidharth","Sidharth Aggarwal","Siloni Goel","Simar Singh Sethi","Simardeep Kaur","Simarpreet Singh","Simranjeet Singh Saggu","Simranjit Kaur","Simranjit Singh Gill","Sohail Singh","Sohan Lal Gupta","Sohil Batra","Sohrab Singh","Sona Jain","Sorabh Jindal","Sorabh Sood","Sourabh Deorah","Sourabh Manna","Sourav Modi","Srikanth Srinivas Iyer","Srivatsan Sridharan","Subash Vohra","Subhash C Gupta","Subhash C Munjal","Sudershan Kumar","Sudhir  Gupta","Sudhir Sinha","Sujeet Kumar","Sukhchain Goyal","Sukhcharanjit Singh Chahal","Sukhdeep Cheema Kakar","Sukhmander Singh","Sukhminder Singh","Sukhraj Bahadur Singh","Suman A Sehra","Suman Kumar","Sumedha Goel","Sumedha Singla","Sumeet","Sumeet Goyal","Sumeet Makkar","Sumeet Malhotra","Sumeet Malik","Sumeet Mann","Sumeet Singh","Sumer Bansal","Sumit","Sumit","Sumit Bansal","Sumit Das","Sumit Jindal","Sumit Kumar","Sumitar Nouhria","Sunder Lal Jain","Sunil Bansal","Sunil Das","Sunil Gupta","Sunil Gupta","Sunil Khevaria","Sunil Kumar","Sunil Prakash","Sunil Rihan","Sunil Singla","Sunit Bawa","Sunit Singla","Sunmeet Sidhu","Sunny Mittal","Supreet Kanwal","Surender Kumar Lamba","Surendra Nath Agarwal","Suresh","Suresh Ganju","Suresh Kumar Kapoor","Surinder Kumar Sardana","Surinder Singla","Surjeet Singh Dhillon","Surjit Singh Zandoo","Sushant Mittal","Sushant Sethi","Sushil","Sushil Kumar","Sushma","Swati","Tajeshwar Singh","Tajinder Singh Virdi","Tanay Manohar Kapoor","Tanmay Kachhwaha","Tanveer Dhillon","Tanvir Kaur","Taranjana Singh","Taranjeet Singh Ahuja","Taranjeet Singh Khanuja","Tarun garg","Tarun Gupta","Tarun Jain","Tarun Kumar","Tarun Kumar Garg","Tarun Sharma","Tarun singh","Tarush Grover","Tejbir Singh Sawhney","Tejeet Singh","Tejinder Paul Singh","Tikka Hamendra Chand","Tushar Chaudhary","Tushar Chugh","Tushar Jain","Umesh Batta","Upas Chauhan","V K Shailesh Kumar Chetty","V.K.Puniani","Vaibhav Chopra","Vaibhav Sharma","Vaibhav Srivastava","Vandna Singla","Vaneet Kaur","Vani Oswal","Varinder","Varinder Arora","Varinder Kumar","Varinder Sahota","Varun","Varun Arora","Varun Bajaj","Varun Bhatti","Varun Checker","Varun Chhabra","Varun Gautm","Varun Gulati","Varun Gupta","Varun Kathuria","Varun Raj Atri","Viajy Kumar Nayyar","Vijay","Vijay Arora","Vijay Kumar Anand ","Vijay Kumar Atteri","Vijay Kumar Malik","Vijay Singh Thakur","Vikalp Gupta ","Vikas Bhanot","Vikas Bindal","Vikas Duggal","Vikas Garg","Vikas Garg","Vikas Gupta","Vikas Jindal","Vikas Kapil","Vikas Kumar","Vikas Kumar","Vikrant Singh","Vimal Anand","Vinay Mittal","Vinay Sharma","Vineet Aggarwal","Vineet Singh","Vinit Kumar Gupta","Vipan","Vipan Kumar","Vipul Bansal","Vipul Mangla","Vipul Vohra","Virat Mittal","Vishal Duggal","Vishal Garg","Vishal Goyal","Vishal Sarangal","Vishal Seth","Vishal Soni","Vishesh Sarangal","Vivek Chand","Vivek Goyal","Vivek Gupta","Vivek Kumar Singh","Vivek Modgil","Vivek Raghuvanshi","Vivek Sarmal","Vivek Somani","Viveka Sra","Yash Chaudhary","Yash Paul","Yashbir Singh","Yashupriya","Yatin Singla","Yogesh Malhotra","Yogesh Mittal","Yogesh Sharma","Yugam Khosla","Yukti Kanwar","Zareen","Rupinder","Nitish","Ashish Tyagi","Nipun Goyal","Avneet Singh","Madhukar Aggarwal","Sharad Chandak","Amit Garg","Sharad Chandak"};
	int i, num_strings=sizeof(s)/sizeof(char*); 
	//strArrayToLower(s);
	node* start[TOTAL_CHARS];//={NULL};
	for(i=0; i<TOTAL_CHARS; i++)	
		start[i]=NULL;

	makeTrie(start, s, num_strings);
	takeInput(start);
	
	for(i=0; i<TOTAL_CHARS; i++)
	if(start[i] != NULL)
		freeTrie(start[i]);
	return 0;
}
Пример #7
0
/**
 * Checks the spelling of a list of words against a list of dictionary words.
 * Any misspellings are reported to a callback function, along with a suggested
 * correction. The suggested correction is chosen to minimise the "edit
 * difference" between it and the original word. If no dictionary word is
 * within the maximum allowable distance from the original word, the callback
 * receives NULL instead of a suggestion.
 *
 * The callback function returns either TRUE or FALSE, indicating whether the
 * suggested correction should be applied. If TRUE, the memory allocated to the
 * original word is realloc'd to make space for the corrected word, which is
 * then copied into it.
 *
 * Parameters:
 * text          - an array of words to spell check (each word must be
 *                 dynamically allocated);
 * textLength    - the number of words to spell check;
 * dict          - an array of words to use as the dictionary;
 * dictLength    - the number of dictionary words;
 * maxDifference - the maximum difference between misspelt words and their
 *                 suggested corrections;
 * action'       - a pointer to a function that will be called for each
 *                 misspelt word.
 */
void check(char* text[], int textLength, char* dict[], int dictLength, int maxDifference, ActionFunc action)
{
	/* Construct a trie to represent the set of all the dictionary words. */
	TrieNode* trie = buildTrie(dict, dictLength);
	
	char* suggestion = NULL;
	int maxLen = 0;
	int t;
	
	for(t = 0; t < textLength; t++)
	{
		int len = strlen(text[t]);
		if(maxLen < len) {
			/* Maintain a buffer to store, temporarily, the correction for each
			 * word. Increase the size of the buffer as needed. */
			maxLen = len;
			suggestion = (char*)realloc(suggestion, sizeof(char) * (maxDifference + maxLen + 1));
		}
		
		/* Check whether the word, or an edited version thereof, is in the trie. */
		if(!inTrie(trie, text[t], suggestion, maxDifference)) {
			/* Misspelling, with no suggestion available. */
			(*action)(text[t], NULL);
		}
		else if(strcmp(text[t], suggestion) != 0)
		{
			/* Misspelling, with suggested correction */
			if((*action)(text[t], suggestion)) {
				text[t] = (char*)realloc(text[t], (strlen(suggestion) + 1) * sizeof(char));
				strcpy(text[t], suggestion);
			}
		}
	}
	
	free(suggestion);
	freeTrie(trie);
}
Пример #8
0
void decode () {
    int possition = 0;
    int code = 9;
    Tree codeTrie;
    createT(&codeTrie);
    int codeCount = 1;
    int *outputString = malloc(sizeof(int));
    int *lastString = NULL;
    outputString[0] = -1;
    int * nextString = NULL;
    int bitsCount = 8;
    int getMaxBits = getBits(bitsCount);
    setMaxBits(getMaxBits);
    int Escaped = getBits(1);
    if (Escaped) {
        setEscaped();
    }
    else {
        initializeTrie(&codeTrie);
    }
    int shouldPrune = getBits(1);
    if (shouldPrune) {
        setShouldPrune();
    }
    while ((code = getBits(bitsCount)) != EOF) {
        if (code == 0 && Escaped) {
            int singleLetter = getBits(8);
            nextString = malloc(2 * sizeof(int));
            nextString[0] = singleLetter;
            nextString[1] = -1;
        }
        else {
            nextString = checkForNextCode(&codeTrie, code);
        }
        if (!nextString) {
            nextString = addLetterToStringNoFree(lastString, lastString[0]);
            
        }
        printArray(nextString);
        int *output = combine(outputString, nextString, possition);
        free(outputString);
        outputString = output;
        possition = addStringToTrie(&codeTrie, outputString, 0, &codeCount);
        int stringLength = arrayLen(nextString);
        if (lastString) {
            free(lastString);
            lastString = NULL;
        }
        lastString = malloc((arrayLen(nextString) + 1) * sizeof(int));
        for (int i = 0; nextString[i] != -1; i++) {
            lastString[i] = nextString[i];
        }
        lastString[stringLength] = -1;
        bitsCount = getBitsCount();
        free(nextString);
        nextString = NULL;
    }
    if (lastString) {
        free(lastString);
    }
    freeTrie(&codeTrie);
    free(outputString);
}
Пример #9
0
struct TrieNode *loadTagCountFile(FILE *fIn){
	int  c     = 0;       /* Character input from file */
	int  index = 0;       /* Line number in file */
	struct TrieNode *pRoot = NULL; /* Root of the trie */
	struct TrieNode *pNode = NULL; /* Working node in the trie */

	if (fIn == NULL) return NULL;

	/* Initialize the trie and point the working node to it */
	pRoot = initNode();
	if (pRoot == NULL) return NULL;


	/* Loop through each line */
	for (index = 1; ; index++){
	
		/* Loop through each character in the tag */
		pNode = pRoot;
		for (c = fgetc(fIn); c=='A'||c=='C'||c=='G'||c=='T'; c = fgetc(fIn)){
			/* Add the character to the trie and update the node */
			pNode = add(pNode, c);
			
			if (pNode == NULL){
				/* Couldn't add node */
				printf("Error at line %i, could not add node\n", index+1);
				freeTrie(&pRoot);
				return NULL;
			}
		}
		
		/* Try to create a new leaf */
		pNode->pLeaf = malloc(sizeof(*(pNode->pLeaf)));
		if (pNode->pLeaf == NULL){
			/* Couldn't allocate memory for a leaf */
			printf("Error at line %i, could not add leaf\n", index+1);
			freeTrie(&pRoot);
			return NULL;
		}
		/* Initialize leaf */
		pNode->pLeaf->index = index;
		pNode->pLeaf->tagLength = 0;
		pNode->pLeaf->tagFreq = 0;
		
		
		if (c == EOF) {
			/* Abrupt end of file, but okay */
			printf("Warning: Unexpected EOF encountered\n");
			return pRoot;
		}
		
		/* Read tag length number */
		for (c = fgetc(fIn); isdigit(c); c = fgetc(fIn))
			reverseIntegerParser(&(pNode->pLeaf->tagLength), c);
		
		if (c == EOF) {
			/* Abrupt end of file, but okay */
			printf("Warning: Unexpected EOF encountered\n");
			return pRoot;
		}
		
		/* Read tag frequency number */
		for (c = fgetc(fIn); isdigit(c); c = fgetc(fIn))
			reverseIntegerParser(&(pNode->pLeaf->tagFreq), c);
		
		/* Burn through junk after last number */
		for (; c!=EOF && c!='\n' && c!='\r'; c = fgetc(fIn)){;}
		
		if (c == EOF) {
			/* Done */
			return pRoot;
		}
	}
}