logow

Data Structures Interview Questions Google


Diploma Data Structures and Algorithms Paper Solve



C Language
credits to brpaper.com


what is data structures explain it's types


Data Structures - - Data structures is the Particular way of organizing data in computer so that can be used Effectively.A data structures is design to store,retrieve,update data in appropriate way and it's describe that collection of data,some values and contains relationship among them .So data structures explain all overall picture of software Program and how Information Stored in memory.

There are 2 types of Data Structures in Programming..

  1. Linear Data Structures
  2. Non-Linear Data Structures 
1.) Linear Data structures....Those Data Structures which are stored in memory in Sequentially Format is called Linear Data Structures.
For Example..
  1. Array         ( Tap on Array to see full Data structures concepts ).
  2. Linked List   ( Tap on Linked List to see full Data structures concepts ).
  3. Stack          ( Tap on Stack to see full Data structures concepts ).
  4. Queues        ( Tap on Queues to see full Data structures concepts ).
2.) Non-Linear Data Structures.....Those Data Structures which are stored in memory in Hierarchical Manner is called Non-Linear Data Structures.
For Example..
  1. Tree's     (Tap on Tree's to download Trees Latest Notes).
  2. Graph     (Tap on Graph to download Trees Latest Notes).


Binary Search Algorithm 


Definition - - Binary search algorithm is a mechanism to find or search elements from the Given Array List.But one Condition of Binary search is Array's Elements are must be in sorted form.Basically It's works on a Divide and Conquer method.it is very fast searching algorithm in Data Structures if you find middle element.

Algorithms steps for Binary Search - - 

Step 1 - Read the Enter element from the user.
Step 2 - Find the middle element in the sorted list by using Formula mid=(first+last)/2.
Step 3 - Compare the search element with the middle element in the sorted list.
Step 4 - If both are matched, then display "Enter element is found!!!" and terminate the function.
Step 5 - If both are not matched, then check whether the search element is smaller or larger than the middle element.
Step 6 - If the search element is smaller than middle element, repeat steps 2, 3, 4 and 5 for the left sub-list of the middle element.
Step 7 - If the search element is larger than middle element, repeat steps 2, 3, 4 and 5 for the right sub-list of the middle element.
Step 8 - Repeat the same process until we find the search element in the list or until sub-list contains only one element.
Step 9 - If elements still not found then display to user a message element not found . 



Linked List Algorithm to Insert Element at any Specific Position



Definition - - A Linked List is a Linear Data Structures which are not stored in memory continuously.Basically,it is a collection of Nodes which are stored in memory Randomly.Each node contains two fields called info part and link part.Info part contain Information or data and  

There are three Four of Linked List.....It is used for Dynamic Memory Allocation.


  1. Singly Linked List
  2. Doubly Linked List
  3. Circular Linked List
  4. Circular Doubly Linked List

Representation Of Linked List.....




Algorithm to Insert Node at any Position....


  1. Read user position and data.
  2. If Position==1 then execute Beginning Line of Program.
  3. If traverse found NULL then print wrong Position. 
  4. Traversed the Linked List to Position-1 nodes.
  5. Allocate data and give memory to the new node.
  6. Link new node to previous and next node.








POPS VS OOPS OR Bottom up and Top down Programming.....

POPS And OOPS the major difference is Purpose of Security.

Serial No. POPS OOPS
1. In top-down approach we breaking the problems into modules in a reverse engineering fashion. A bottom-up approach is the piecing together of module to give rise to more complex program.
2. C Programming follows top-down Approach. Java,C++ follows bottom-up Approach.
3. Starts with High level Design and End with Low level Design. Starts with Low level Design and End with Low level Design.
4. In POPS approach we mainly Focus on Problem. In OOPS approach we mainly Focus on Security.
5. In POPS we create first main function then create sub-functions if needed. In OOPS we create modules and then create main functions.



Application of Stack and Queue


Stack------

  • Stack used to Evaluate Postfix and Infix Expressions.
  • Stack used to Implement Recursion Algorithms. 
  • The simplest use of stack in Word Processing to reverse a word.You push a given word to stack Letter by Letter and then pop letters from the Stack.
  • We all see option of Undo and Redo in Text editors like Notepad's using Stack we keeping all changes in a Stack.
  • Stack Used in Backtracking means we want to access recent data from the system.
  • For Example..
  • we open 10 windows application in our PC's then all open's apps Backtracked into the Stack and popping out of our Choices.
  • Stack used to store the Titles of Books in Project Program,
  • Another Example...
  • In C Program we use Curly Braces then Compiler matching braces both open and close braces using Stack.

Queue........

Queue use FIFO techniques that's means recently added Elements remove First.

For Example .. Railway Station Ticket Counter.

  1. Basically,Queue used by Operating System in Scheduling Algorithms like FCFS first come process get Processor First and release first same Process apply in Disk Scheduling.
  2. Serving requests on a single shared resource like a printer.
  3. Call center use Queue's to hold people calling them in a order until a service representative Free.
  4. Handling of Interrupts in a real-time Systems same orders then First come First Serve.
  5. Queue also used in a Expression Evaluation.

Drawback of Linked List.....


More Memory Usage

More memory is required to store elements in linked list as compared to array. Because in linked list each node contains a pointer and it requires extra memory for itself.

Access each Elements of Linked List Called Traversal

Elements or nodes traversal is difficult in linked list. We can not randomly access any element as we do in array by index. For example if we want to access a node at position n then we have to traverse all the nodes before it. So, time required to access a node is large.

Reverse Traversing of Linked List 

In linked list reverse traversing is really difficult. In case of doubly linked list its easier but extra memory is required for back pointer hence wastage of memory.

To overcome from more Memory Usage Drawbacks of Linked List you must Implement using Array Elements of Fixed Length Because Pointer Variables Takes more memory.


Algorithm for Push and Pop operation on Stack

To see this Answer Press Below link  ↓↓↓↓↓↓↓↓↓
                                 Stack Algorithms



Evaluate Postfix Operation in Stack 







Things to be remember before going to solution's

Priorities to signs ....






Solution-----

First we convert Infix into Postfix then Evaluate......



P
Justok! by Amit......



Steps to Evaluate Postfix Expression....


  1. Scan from Left to Right.
  2. If operand occur push in to the Stack.
  3. If operator occur pop from Stack.
  4. Push back the result into Stack.
  5. Repeat until Expression is not Evaluate.





E
forloop4.blogspot.com



Download Image Of Infix to Postfix PDF 






#StayHome










Explain and Solve By Amit 

Technical Content Writer And Owner Of Justok! Website 

Post a Comment

0 Comments