The stack operations are push and pop
These operations on linked list are "ADD IN THE BEGINNING",and "DELETE IN THE BEGINNING"
THE OPERATIONS ARE PUSH AND POP
PUSH OPERATION:
The operation here is push so we insert new node at the beginning of the li...
apurva apurva
Posted on March 15th, 2019
Definition: The stack is a data structure which follows the principle of LAST IN FIRST OUT
Consider data stored in stack be
1 2 3 4 5 6
Let they be inserted one after the other then stack looks like..
654321The position of 6 is called TOP position.Any...
apurva apurva
Posted on March 12th, 2019
ANAGRAM:Given two strings are said to be anagrams only when they are formed with same characters with characters repeating same number of times.
For example:
SKILL
KILLS
Here
charactercount in string onecount in string twos11k11i11l22Hence we can say...
apurva apurva
Posted on March 1st, 2019
Patterns for a triangle and a 'x' pattern
TRIANGLE PATTERN
------*
* *
* * *
* * * *
* * * * *
This pattern has some generality
inumber of starsnumber of spaces114223332441550Two loops are used because there are rows and col...
apurva apurva
Posted on February 27th, 2019
The delete operation on linked list can be done in 3 different positions .They are
At the beginning
In the middle
At the end
BEGINNING
The head pointer need to be moved to the next node,
head=head->nextEND
use a dummy variable to store the head poi...
apurva apurva
Posted on February 26th, 2019
The single list is a structure node with data field and a pointer to struct .
node declaration is
struct node
{
int data;
struct node *next;
};The operations on a single linked list
push(int data)
delete (int data)
print(struct *head )
PUSH operation:
...
apurva apurva
Posted on February 25th, 2019
Linked lists are a user defined data data structures,used to store data and memory is allocated for linked lists dynamically,linked lists can be modified based on user's interest.
It is usually modeled as structure with one data field and one address ...
apurva apurva
Posted on February 24th, 2019
problem statement:
Dan is playing a video game in which his character competes in a hurdle race. Hurdles are of varying heights, and Dan has a maximum height he can jump. There is a magic potion he can take that will increase his maximum height by 1
u...
apurva apurva
Posted on February 22nd, 2019
Problem statement:
Problem can be found in hackerrank follow this to solve the problem
https://www.hackerrank.com/challenges/divisible-sum-pairs/problem
Explanation:
HOW TO SOLVE:
use two loops and add each existing pair and check whether the sum i...
apurva apurva
Posted on February 21st, 2019
This looks different ,but this says more about using loops and using loop variables.
Print a multiplication table for table 2
ianswer122436485106127148169181020Program code is int i;
for(i=10;i>0;i--)
printf("%d x %d =%d\n",2,i,2*i);This code prints...
apurva apurva
Posted on February 20th, 2019