From 3a5b1b233ba9a1435909ef638a516ff2bab35199 Mon Sep 17 00:00:00 2001 From: sonal251001 <73117995+sonal251001@users.noreply.github.com> Date: Tue, 25 May 2021 15:01:50 +0530 Subject: [PATCH] Add insert at start --- insertAtStart.java | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 insertAtStart.java diff --git a/insertAtStart.java b/insertAtStart.java new file mode 100644 index 0000000..56605af --- /dev/null +++ b/insertAtStart.java @@ -0,0 +1,33 @@ +public class insertAtStart { + int count = 0 ; + public static void main(String[] args) { + insertAtStart obj = new insertAtStart(); + int a[] = new int [5]; + for(int j=0; j0; i--) + { + a[i] = a[i-1]; + } + + a[0] = val; + } + + public void print(int a[]) + { + for(int i=0; i