SlideShare a Scribd company logo
1 of 2
…Insert In a Binary Search Tree…
1. #include <stdio.h>
2. #include <stdlib.h>
3.
4. struct node {
5. int key;
6. struct node *left, *right; };
7.
8. // A utility function to create a new BST node
9. struct node* newNode(int item)
10. { struct node* temp = (struct node*)malloc(sizeof(struct
node));
11. temp->key = item;
12. temp->left = temp->right = NULL;
13. return temp;
14. }
15.
16. // A utility function to do inorder traversal of BST
17. void inorder(struct node* root)
18. {
19. if (root != NULL)
20. { inorder(root->left);
21. printf("%d ", root->key);
22. inorder(root->right);
23. }
24. }
25.
26. // A utility function to insert
27. // a new node with given key in BST
28. struct node* insert(struct node* node, int key)
29. {
30. // If the tree is empty, return a new node
31. if (node == NULL)
32. return newNode(key);
33.
34. // Otherwise, recur down the tree
35. if (key < node->key)
36. node->left = insert(node->left, key);
37. else if (key > node->key)
38. node->right = insert(node->right, key);
39.
40. // Return the (unchanged) node pointer
41. return node;
42. }
43.
44. // Driver Code
45. int main()
46. {
47. struct node* root = NULL;
48. root = insert(root, 50);
49. insert(root, 30); insert(root, 20);
50. insert(root, 40); insert(root, 70);
51. insert(root, 60); insert(root, 80);
52.
53. return 0;
54. }
 TC to find rank of matrix: O(row*col) = Row Red Echelon Form + CREF + no of non-zero in diagonal ( i.e
(row*col)+(row*col)+(row*col) )
 The rank–nullity theorem is a theorem in linear algebra, which asserts. of a matrix M that
its rank + its col nullity = the number of columns.
 Bayes' Theorem states that the conditional probability of an event,
based on the occurrence of another event, is equal to the likelihood
of the second event given the first event multiplied by the probability
of the first event.
 k-means clustering is a method of vector quantization, originally from signal processing, that aims to
partition n observations into k clusters in which each observation belongs to the cluster with the nearest
mean (cluster centers or cluster centroid), serving as a prototype of the cluster. This results in a
partitioning of the data space into Voronoi cells. k-means clustering minimizes within-cluster variances
 When the number of clusters, K is increased, the distance from centroid to data points will be decreased
and will reach a point where K is the same as the number of data points. This is the reason we have been
using the mean of the distance to the centroids.
 Temporal Locality means that a instruction which is recently executed have high chances of execution
again. So the instruction is kept in cache.
 Spatial locality (also termed data locality) refers to the use of data elements within relatively close storage
locations. Think of codes using special & temporal
 Dynamic Host Configuration Protocol (DHCP) is a network protocol that is used to configure network
devices to communicate on an IP network. A DHCP client uses the DHCP protocol to acquire configuration
information, such as an IP address, a default route, and one or more DNS server addresses from a DHCP
server.

More Related Content

Similar to IIT Hyd exam preps.docx

Assg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docx
Assg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docxAssg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docx
Assg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docx
festockton
 
Programming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorialProgramming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorial
Jeff Smith
 
Programming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorialProgramming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorial
Jeff Smith
 
CloudClustering: Toward a scalable machine learning toolkit for Windows Azure
CloudClustering: Toward a scalable machine learning toolkit for Windows AzureCloudClustering: Toward a scalable machine learning toolkit for Windows Azure
CloudClustering: Toward a scalable machine learning toolkit for Windows Azure
Ankur Dave
 

Similar to IIT Hyd exam preps.docx (20)

Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New Tricks
 
Assg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docx
Assg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docxAssg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docx
Assg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docx
 
iOS Session-2
iOS Session-2iOS Session-2
iOS Session-2
 
Programming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorialProgramming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorial
 
Programming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorialProgramming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorial
 
Survey onhpcs languages
Survey onhpcs languagesSurvey onhpcs languages
Survey onhpcs languages
 
Exploring Parallel Merging In GPU Based Systems Using CUDA C.
Exploring Parallel Merging In GPU Based Systems Using CUDA C.Exploring Parallel Merging In GPU Based Systems Using CUDA C.
Exploring Parallel Merging In GPU Based Systems Using CUDA C.
 
Dynamic Memory Allocation.pptx
Dynamic Memory Allocation.pptxDynamic Memory Allocation.pptx
Dynamic Memory Allocation.pptx
 
Lec09 nbody-optimization
Lec09 nbody-optimizationLec09 nbody-optimization
Lec09 nbody-optimization
 
SNMP Project: SNMP-based Network Anomaly Detection Using Clustering
SNMP Project: SNMP-based Network Anomaly Detection Using ClusteringSNMP Project: SNMP-based Network Anomaly Detection Using Clustering
SNMP Project: SNMP-based Network Anomaly Detection Using Clustering
 
CloudClustering: Toward a scalable machine learning toolkit for Windows Azure
CloudClustering: Toward a scalable machine learning toolkit for Windows AzureCloudClustering: Toward a scalable machine learning toolkit for Windows Azure
CloudClustering: Toward a scalable machine learning toolkit for Windows Azure
 
Exploitation of counter overflows in the Linux kernel
Exploitation of counter overflows in the Linux kernelExploitation of counter overflows in the Linux kernel
Exploitation of counter overflows in the Linux kernel
 
UNIT 3a.pptx
UNIT 3a.pptxUNIT 3a.pptx
UNIT 3a.pptx
 
D03601023026
D03601023026D03601023026
D03601023026
 
Seattle Scalability Meetup 6-26-13
Seattle Scalability Meetup 6-26-13Seattle Scalability Meetup 6-26-13
Seattle Scalability Meetup 6-26-13
 
Log Analytics in Datacenter with Apache Spark and Machine Learning
Log Analytics in Datacenter with Apache Spark and Machine LearningLog Analytics in Datacenter with Apache Spark and Machine Learning
Log Analytics in Datacenter with Apache Spark and Machine Learning
 
Log Analytics in Datacenter with Apache Spark and Machine Learning
Log Analytics in Datacenter with Apache Spark and Machine LearningLog Analytics in Datacenter with Apache Spark and Machine Learning
Log Analytics in Datacenter with Apache Spark and Machine Learning
 
A NOVEL OPTIMIZATION OF CLOUD INSTANCES WITH INVENTORY THEORY APPLIED ON REAL...
A NOVEL OPTIMIZATION OF CLOUD INSTANCES WITH INVENTORY THEORY APPLIED ON REAL...A NOVEL OPTIMIZATION OF CLOUD INSTANCES WITH INVENTORY THEORY APPLIED ON REAL...
A NOVEL OPTIMIZATION OF CLOUD INSTANCES WITH INVENTORY THEORY APPLIED ON REAL...
 
A Novel Optimization of Cloud Instances with Inventory Theory Applied on Real...
A Novel Optimization of Cloud Instances with Inventory Theory Applied on Real...A Novel Optimization of Cloud Instances with Inventory Theory Applied on Real...
A Novel Optimization of Cloud Instances with Inventory Theory Applied on Real...
 
A NOVEL OPTIMIZATION OF CLOUD INSTANCES WITH INVENTORY THEORY APPLIED ON REAL...
A NOVEL OPTIMIZATION OF CLOUD INSTANCES WITH INVENTORY THEORY APPLIED ON REAL...A NOVEL OPTIMIZATION OF CLOUD INSTANCES WITH INVENTORY THEORY APPLIED ON REAL...
A NOVEL OPTIMIZATION OF CLOUD INSTANCES WITH INVENTORY THEORY APPLIED ON REAL...
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

IIT Hyd exam preps.docx

  • 1. …Insert In a Binary Search Tree… 1. #include <stdio.h> 2. #include <stdlib.h> 3. 4. struct node { 5. int key; 6. struct node *left, *right; }; 7. 8. // A utility function to create a new BST node 9. struct node* newNode(int item) 10. { struct node* temp = (struct node*)malloc(sizeof(struct node)); 11. temp->key = item; 12. temp->left = temp->right = NULL; 13. return temp; 14. } 15. 16. // A utility function to do inorder traversal of BST 17. void inorder(struct node* root) 18. { 19. if (root != NULL) 20. { inorder(root->left); 21. printf("%d ", root->key); 22. inorder(root->right); 23. } 24. } 25. 26. // A utility function to insert 27. // a new node with given key in BST 28. struct node* insert(struct node* node, int key) 29. { 30. // If the tree is empty, return a new node 31. if (node == NULL) 32. return newNode(key); 33. 34. // Otherwise, recur down the tree 35. if (key < node->key) 36. node->left = insert(node->left, key); 37. else if (key > node->key) 38. node->right = insert(node->right, key); 39. 40. // Return the (unchanged) node pointer 41. return node; 42. } 43. 44. // Driver Code 45. int main() 46. { 47. struct node* root = NULL; 48. root = insert(root, 50); 49. insert(root, 30); insert(root, 20); 50. insert(root, 40); insert(root, 70); 51. insert(root, 60); insert(root, 80); 52. 53. return 0; 54. }
  • 2.  TC to find rank of matrix: O(row*col) = Row Red Echelon Form + CREF + no of non-zero in diagonal ( i.e (row*col)+(row*col)+(row*col) )  The rank–nullity theorem is a theorem in linear algebra, which asserts. of a matrix M that its rank + its col nullity = the number of columns.  Bayes' Theorem states that the conditional probability of an event, based on the occurrence of another event, is equal to the likelihood of the second event given the first event multiplied by the probability of the first event.  k-means clustering is a method of vector quantization, originally from signal processing, that aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean (cluster centers or cluster centroid), serving as a prototype of the cluster. This results in a partitioning of the data space into Voronoi cells. k-means clustering minimizes within-cluster variances  When the number of clusters, K is increased, the distance from centroid to data points will be decreased and will reach a point where K is the same as the number of data points. This is the reason we have been using the mean of the distance to the centroids.  Temporal Locality means that a instruction which is recently executed have high chances of execution again. So the instruction is kept in cache.  Spatial locality (also termed data locality) refers to the use of data elements within relatively close storage locations. Think of codes using special & temporal  Dynamic Host Configuration Protocol (DHCP) is a network protocol that is used to configure network devices to communicate on an IP network. A DHCP client uses the DHCP protocol to acquire configuration information, such as an IP address, a default route, and one or more DNS server addresses from a DHCP server.