Posts

Showing posts from November, 2023

MPMC LAB question

 MPMC LAB question 1.8086 ALP to find number of odd and even numbers in an array  2.8051 ALP to find number of 1's and 0's in a 16 bit number  3. 32 bit addition subtraction in 8086  4. 8051 cube of a number  5.8051 -  Ascending order  6.8086 - Find the number of 1's and 0's in 16 bit number   7. 8086 swap the upper and lower nibble of a 8 bit number for array of numbers   8. Masm floating point addition and subtraction  9. 8086 sum of Fibonacci series  10. 8051 BCD to Hexadecimal  11. 8051 Sum of 16bit number  12.masam case conversion  13.8086 Alp to find sum of numbers in an array  14.8051 Alp to find sum of even numbers in an array  15. Matrix addition  16. 8086 odd even in array  17.8086-factorail of a number, string manipulation  18. 8279 Keyboard left rolling Display CHEnnAI (similar to HELP US)  19.Hexadecminal to BCD using 8051

Convert binary to decimal in c using built in function

Image
 Convert binary to decimal in c using built in function     In C, you can use the strtol function from the <stdlib.h> library to convert a binary string to a decimal number. strtol stands for "string to long integer."  Syntax:  long strtol(const char *nptr, char **endptr, int base); nptr : The string you want to convert to a number. endptr : The address of the first character that's not part of the number (if provided). base : The numerical base of the string (e.g., 2 for binary, 10 for decimal).         This code snippet demonstrates converting the binary string "101010" to its decimal equivalent using strtol . The base parameter 2 specifies that the string is in binary format. Adjust the binaryString variable to contain the binary string you want to convert. ```c #include <stdio.h> #include <stdlib.h> int main () { char binaryString [] = "101010" ; long decimal = strtol ( binaryString , NULL...

DFS in Complete Tree

Image
  DFS in Complete Tree  "DFD" typically stands for "Data Flow Diagram." It's a graphical representation used in software engineering and systems analysis to illustrate how data moves through a system. However, it's not an algorithm like BFS or DFS. Completeness: DFDs depict data flow in a system but might not cover every detail, depending on the diagram's level of abstraction. Time & Space Complexity: the time complexity of both DFS and BFS is O(V + E) , where V represents the number of vertices and E represents the number of edges in the graph. And, the space complexity of DFS and BFS is O(V), in the worst case Optimality: DFDs are design tools; their value lies in effectively illustrating data flow for system understanding and analysis, rather than being inherently optimal or non-optimal. Tree:    Code: class Node : def __init__ ( self , value ): self . data = value self . left = None self . right = None...