Posts

Showing posts from August, 2015

Program to merge two sorted linked lists

Given two sorted linked list which are sorted in increasing order. Write a function to merge these two sorted linked list.

Program for sorted insertion in linked list

Write a function to insert a node in linked list as sorted manner. For example if linked list is 3->5->23->45->65 and we want to insert a node in which data is 22 then insert it at its correct position which is between 5 and 23.

Program to insert node at nth position in linked list

Write a function to insert a node at given position. Simple C Program to insert node at nth position.

Program to count the frequency of an element in linked list

Write a function that count the frequency or occurrence of a given element Or count the total number of nodes which have data equal to a given number.

Simple Program to delete given node from linked list

C Program for deletion of a given node from linked list. For example if linked list is 2->3->23->7->54->34 then we are given to delete a node in which data is 23 or 34.

how to delete node from end of linked list

Given a linked list, delete a node from end of linked list. Here is simple C Program to delete node from end of linked list.

Delete Node from beginning of linked list

C Program to delete node from beginning position of linked list. Simple C program to delete nodes.

Insert Node at the end of linked list

C Program to insert node at the end of linked. Program to add node at the end of linked list.

Insert Node at the beginning of linked list

Image
Write a function to insert node or element at the beginning of linked list. C Program to insert node or element at the beginning of linked list.

Binary Searching: Find last occurrence of element in array

Simple C program to find last occurrence index of an element in sorted array. For example if array is {34,45,45,45,56,57,57,68,78,78,78,78} then last occurrence of element 45 is at index 3 and last occurrence of element 78 is at index 11.

Binary Searching: Find first occurrence of element in sorted array

Binary searching is an algorithm to search an element in sorted array. Here is C program to find first occurrence of an element in array.

Find an element frequency in sorted array

Simple C program to calculate frequency of an element in sorted array. This program is based on divide and conquer method.

Binary Search: Search an element in sorted array recursively

C program for binary searching: Binary searching recursively program. Here is simple C program for binary searching using recursion. Binary searching prerequisite's that array should be sorted. In unsorted array binary searching does not works.

Binary Search: Search an element in sorted array recursively

C program for binary searching: Binary searching recursively program. Here is simple C program for binary searching using recursion. Binary searching prerequisite's that array should be sorted. In unsorted array binary searching does not works.