What do you want to save?
Add Code snippet
New code examples
-
C++ 2021-11-10 05:45:19
print elements of linked list
typedef struct node{ int value; //this is the value the node stores struct node *next; //this is the node the current node points to. this is how the nodes link }node; void printList(node *head){ node *tmp = head; while(tmp != NULL){ ... Add solution -
C++ 2021-11-09 00:08:08
Dfs program in c++
############### #The Algorithm (In English): # 1) Pick any node. # 2) If it is unvisited, mark it as visited and recur on all its # adjacent nodes. # 3) Repeat until all the nodes are visited, or the node to be # searched is found. # The grap... Add solution -
TypeScript 2021-11-08 23:49:17
how to get all the elements in xpath java
XPathExpression expr = xpath.compile("//Yourpath"); NodeList list= (NodeList) expr.evaluate(doc, XPathConstants.NODESET); for (int i = 0; i < list.getLength(); i++) { Node node = list.item(i); System.out.println(node.getTextContent()); Add solution -
Python 2021-11-08 16:38:07
convert c++ code to python online
// Program to print path from root node to destination node // for N*N -1 puzzle algorithm using Branch and Bound // The solution assumes that instance of puzzle is solvable #include <bits/stdc++.h> using namespace std; #define N 3 // state space t... Add solution -
Other 2021-11-07 06:13:11
networkx add edge
>>> G = nx.Graph() # or DiGraph, MultiGraph, MultiDiGraph, etc >>> e = (1, 2) >>> G.add_edge(1, 2) # explicit two-node form >>> G.add_edge(*e) # single edge as tuple of two nodes >>> G.add_edges_from([(1, 2)... Add solution -
Shell/Bash 2021-11-06 04:32:14
puppet install on centos 7
curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash - yum install nodejs 1 2 3 4 5 6 7 curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash - yum install nodejs Step 2 :- Install Puppeteer In CentOS 7 npm i pupeteer 1 npm... Add solution -
C++ 2021-11-05 13:45:11
sum of all leaf nodes of binary tree
#include<iostream> using namespace std; struct node { int data; node* left; node* right; }; node* getnode(int value) { node *temp=new node; temp->data=value; temp->left=NULL; temp->right=NULL; return temp; } node* insert_bst... Add solution -
Other 2021-11-05 07:31:08
zigzag traversal of a binary tree
#include<bits/stdc++.h> using namespace std; int main() { //Just reverse the temporary vector containing all nodes at a level zigzagLevelOrder(root); } vector<vector<int>> zigzagLevelOrder(TreeNode* root) { vector<ve... Add solution