What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-30 06:18:05
binary search tree
// Binary Search Tree operations in C #include <stdio.h> #include <stdlib.h> struct node { int key; struct node *left, *right; }; // Create a node struct node *newNode(int item) { struct node *temp = (struct node *)malloc(sizeof(struc... Add solution -
Other 2021-09-29 07:38:02
allies apple problem
We can use binary search. 1. Double the half square side. When we reach the number of collected apples, it stops. 2. Use the binary search to get the minimal perimeter. int CalculateApples(int x) { int result = 0; for (int i = -x+1; i <= x-1; i++) ... Add solution -
C++ 2021-09-23 18:55:04
deletion in a binary search tree
//insertion;deletion;searching;dispaly;menu driven program ;(BINARY SEARCH TREE) #include <iostream> using namespace std; class node { public: int data; node*right; node*left; }; node*getnewnode(int val) { node *temp=new node; t... Add solution -
Other 2021-09-23 15:43:08
bst traversal with recursion c
# include <stdio.h> # include <conio.h> # include <stdlib.h> typedef struct BST { int data; struct BST *lchild, *rchild; } node; void insert(node *, node *); void inorder(node *); void preorder(nod... Add solution -
C++ 2021-09-12 08:20:04
collections c# vs c++
Array - C array, though the .NET Array can have a non-zero starting index. List<T> - std::vector<T> Dictionary<TKey, TValue> - unordered_map<Key, Data> HashSet<T> - unordered_set<Key> SortedDictionary<TKey, TValue>... Add solution