Posts

Showing posts from August, 2020

Data Structure for self Learning

Image
  Data Structure - Recursion Basics Some computer programming languages allow a module or function to call itself. This technique is known as recursion. In recursion, a function   α   either calls itself directly or calls a function   β   that in turn calls the original function   α . The function   α   is called recursive function. in Python Recursion work upto (1000 by Default) Example  − a function calling itself. int function ( int value ) { if ( value < 1 ) return ; function ( value - 1 ); printf ( "%d " , value ); } Example  − a function that calls another function which in turn calls it again. int function1 ( int value1 ) { if ( value1 < 1 ) return ; function2 ( value1 - 1 ); printf ( "%d " , value1 ); } int function2 ( int value2 ) { function1 ( value2 ); } Properties A recursive function can go infinite like a loop. To avoid infinite running of recursive f...
Image
 Big(o) notation Order: List in Data Structure: A linked  list  is a sequence of  data structures , which are connected together via links. Linked  List  is a sequence of links which contains items. Each link contains a connection to another link. Linked  list  is the second most-used  data structure  after array. Following are the important terms to understand the concept of Linked List. Link  − Each link of a linked list can store a data called an element. Next  − Each link of a linked list contains a link to the next link called Next. LinkedList  − A Linked List contains the connection link to the first link called First. Linked List Representation Linked list can be visualized as a chain of nodes, where every node points to the next node. As per the above illustration, following are the important points to be considered. Linked List contains a link element called first. Each link carries a data field(s) and a link fiel...