No products in the cart.

Write a program in c++ to …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

Write a program in c++ to insert a node of a linked list
  • 1 answers

Hasan Ali 6 years, 3 months ago

Struct node // defining a node { Int data; Node*next; Void insert(int n, int x) // n is position x is data Int main ( ) { Head=NULL; } Void insert (int n, int x) { Temp-data=x; Temp-next=NULL; If (n==1) { Temp-next=head; Head=temp; Return; } Node*temp=new node; Temp1=head; For (int=1; i<n-1; i++) // to get to n 1th node { Temp1=temp1-next; } Temp1-next=temp; } Corret me if i am wrong in any line
http://mycbseguide.com/examin8/

Related Questions

What is mean by buffering in file handling?
  • 1 answers
What are called tokens
  • 2 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App