Posts

How to create a Singly linked list usung c++ || data structures || algorithms || coding || learning

  How to create a Singly linked list in c++ #include<iostream> Using namespace std; Struct node{ Int data; Struct node *next; }*first; Void create(int A[],int n){ Struct node *last,*t; First = new node; First-> data = A[0]; First-> next = NULL; Last = first; For(int I = 1 ; I < n ; i++){ T = new node; T -> data = A[i]; Last-> next = NULL;  last = t; } Void display(struct Node *p) { While(p){ If(p) Cout<<p->data<<endl; P = p-> next; } Int main(){ Struct node *p; Int A[] = {1,2,3,4,5}; Create(A,5); Display(first); Return 0; }

How to Find area of triangle using javascript

 How to find area of triangle using javascript Hey this video will help you understand the fundamentals of programming and keep in check with the javascript programming. Video link:: how to find area of triangle using javascript

Javascript program to find square root of a number

Learn how to find the square root of all datatypes. In this video you will be able to understand how to find the square root of a number and all other datatypes with live example and explaination. Video link:  Learn how to find square root of a number

how to insert an element into an array in javascript

Image
 How to insert an element into an array in javascript To create an array in javascript you have to use a variable to store the array data // first use a variable to  store array value var Arr; // This will intialize the array value // Now create the array obj with the help of new Keyword Arr = new Array(); // Now add the elements in the Array using the predefined array method // first to add element we will use the push() method //Syntax: push() // Inorder to add elements you will have to follow these steps: Arr.push(); // Now you can add elements in the array with .push() method //Just mention the element you want to insert //for example Arr.push('apple'); //Now this adds the apple into the array  // How will the array look like  //Array[apple]  //length = 1 // index of apple would be 0 // You can add multiple elements on the go or Add single element one by one as metioned Above // How to add elements on one Go or in one line Arr.push('kiwi',grapes','orange...

ToString method in javascript

toString method in javascript  This method returns a string representing the specified array and its elements. Syntax: toString() Examples: // create an array  Const arr = [1,'7c',112,'2b']; Console.log(arr.toString()); // Expected output  1,7c,112,2b